From 5ad61b6ecd14adffa013ef5b0b8c2b8da8cca03b Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 5 Dec 2007 01:34:39 +0000 Subject: Coding style improvements. --- perl/Wallet/Object/Base.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'perl/Wallet/Object/Base.pm') diff --git a/perl/Wallet/Object/Base.pm b/perl/Wallet/Object/Base.pm index bc9fc1e..ff6f008 100644 --- a/perl/Wallet/Object/Base.pm +++ b/perl/Wallet/Object/Base.pm @@ -23,7 +23,7 @@ use Wallet::ACL; # This version should be increased on any code change to this module. Always # use two digits for the minor version with a leading zero if necessary so # that it will sort properly. -$VERSION = '0.02'; +$VERSION = '0.03'; ############################################################################## # Constructors @@ -357,10 +357,8 @@ sub flag_check { $self->error ("cannot check flag $flag for ${type}:${name}: $@"); $dbh->rollback; return; - } elsif ($value) { - return 1; } else { - return 0; + return ($value) ? 1 : 0; } } @@ -573,7 +571,7 @@ sub show { # Format the results. We use a hack to insert the flags before the first # trace field since they're not a field in the object in their own right. - for (my $i = 0; $i < @data; $i++) { + for my $i (0 .. $#data) { if ($attrs[$i][0] eq 'ob_created_by') { my @flags = $self->flag_list; if (not @flags and $self->error) { -- cgit v1.2.3