X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a..528f8f83ea228ff64f1d05e30f555f75ac2f2ddd:/IkiWiki/Plugin/pagecount.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index a143f24d0..1955603b0 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -26,13 +26,9 @@ sub preprocess (@) { # register a dependency. 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; + my @pages=pagespec_match_list([keys %pagesources], $params{pages}, location => $params{page}) + if $params{pages} ne "*"; # optimisation; + return $#pages+1; } 1