more idiomatic perl
authorJoey Hess <joey@gnu.kitenet.net>
Sun, 4 Apr 2010 16:23:12 +0000 (12:23 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Sun, 4 Apr 2010 16:23:12 +0000 (12:23 -0400)
IkiWiki/Plugin/bzr.pm

index 7eb5cfe93dd9987d63634c05ae51193c97f08915..c96f2d69546f3e95b44e5e3c638064eca7adcfb5 100644 (file)
@@ -83,15 +83,13 @@ sub bzr_log ($) {
                }
                elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
                        $key = "files";
                }
                elsif ($line =~ /^(modified|added|renamed|renamed and modified|removed):/) {
                        $key = "files";
-                       unless (defined($info{$key})) { $info{$key} = ""; }
+                       $info{$key} = "" unless defined $info{$key};
                }
                elsif (defined($key) and $line =~ /^  (.*)/) {
                        $info{$key} .= "$1\n";
                }
                elsif ($line eq "------------------------------------------------------------\n") {
                }
                elsif (defined($key) and $line =~ /^  (.*)/) {
                        $info{$key} .= "$1\n";
                }
                elsif ($line eq "------------------------------------------------------------\n") {
-                       if (keys %info) {
-                               push (@infos, {%info});
-                       }
+                       push @infos, {%info} if keys %info;
                        %info = ();
                        $key = undef;
                }
                        %info = ();
                        $key = undef;
                }