improve use of seen hash

master
Joey Hess 2007-10-30 22:56:13 -04:00
parent 848af1f906
commit 2a6e353c20
1 changed files with 5 additions and 3 deletions

View File

@ -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,10 +238,13 @@ sub expire () { #{{{
$item->{expired}=1;
}
else {
if (! $seen{$item->{page}}) {
$seen{$item->{page}}=1;
$count++;
}
}
}
}
} #}}}
sub aggregate () { #{{{