more idiomatic use of foreach

master
Joey Hess 2009-08-12 12:49:40 -04:00
parent 63ce4459f5
commit 4971f873a0
1 changed files with 3 additions and 3 deletions

View File

@ -318,9 +318,9 @@ sub rcs_recentchanges ($) {
my $hash=$patch->{hash};
my $when=str2time($date);
my (@pages, @files, @pg);
push @pages, $_ for (@{$patch->{summary}->[0]->{modify_file}});
push @pages, $_ for (@{$patch->{summary}->[0]->{add_file}});
push @pages, $_ for (@{$patch->{summary}->[0]->{remove_file}});
push @pages, $_ foreach (@{$patch->{summary}->[0]->{modify_file}});
push @pages, $_ foreach (@{$patch->{summary}->[0]->{add_file}});
push @pages, $_ foreach (@{$patch->{summary}->[0]->{remove_file}});
foreach my $f (@pages) {
$f = $f->{content} if ref $f;
$f =~ s,^\s+,,; $f =~ s,\s+$,,; # cut whitespace