X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/678d467a4080dd549f2b6f276f963eac384e1b4f..e3ccf393c6081e413e1da0eae46ac937a032a13b:/IkiWiki/Plugin/pagecount.pm diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index a143f24d0..f8881a04b 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -27,12 +27,9 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); my @pages=keys %pagesources; - return $#pages+1 if $params{pages} eq "*"; # optimisation - my $count=0; - foreach my $page (@pages) { - $count++ if pagespec_match($page, $params{pages}, location => $params{page}); - } - return $count; + @pages=pagespec_match_list(\@pages, $params{pages}, location => $params{page}) + if $params{pages} ne "*"; # optimisation; + return $#pages+1; } 1