summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/pagecount.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin/pagecount.pm')
-rw-r--r--IkiWiki/Plugin/pagecount.pm9
1 files changed, 3 insertions, 6 deletions
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