diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2007-10-30 22:56:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2007-10-30 22:56:13 -0400 |
commit | 2a6e353c205a6c2c8b8e2eaf85fe9c585c1af0cd (patch) | |
tree | a00097c7cc95b3132462092ed4894893af772071 /IkiWiki/Plugin | |
parent | 848af1f9060935e9aec4b3e843e8055bb8707140 (diff) | |
download | ikiwiki-2a6e353c205a6c2c8b8e2eaf85fe9c585c1af0cd.tar ikiwiki-2a6e353c205a6c2c8b8e2eaf85fe9c585c1af0cd.tar.gz |
improve use of seen hash
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/aggregate.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 1add53987..ea27fc199 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -222,9 +222,8 @@ sub expire () { #{{{ my $count=0; my %seen; foreach my $item (sort { $IkiWiki::pagectime{$b->{page}} <=> $IkiWiki::pagectime{$a->{page}} } - grep { exists $_->{page} && ! exists $seen{$_->{page}} && $_->{feed} eq $feed->{name} && $IkiWiki::pagectime{$_->{page}} } + grep { exists $_->{page} && $_->{feed} eq $feed->{name} && $IkiWiki::pagectime{$_->{page}} } values %guids) { - $seen{$item}=1; if ($feed->{expireage}) { my $days_old = (time - $IkiWiki::pagectime{$item->{page}}) / 60 / 60 / 24; if ($days_old > $feed->{expireage}) { @@ -239,7 +238,10 @@ sub expire () { #{{{ $item->{expired}=1; } else { - $count++; + if (! $seen{$item->{page}}) { + $seen{$item->{page}}=1; + $count++; + } } } } |