aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-11-19 19:20:48 +0000
committerSimon McVittie <smcv@debian.org>2016-12-19 18:21:07 +0000
commitc1890c116d37b01b230112216b893efe57602a23 (patch)
tree2981858ced48540f258fac7ba4415ecd8f37da59
parent592c13cc6169554b075406dae9ca90cdba183fbd (diff)
downloadikiwiki-c1890c116d37b01b230112216b893efe57602a23.tar
ikiwiki-c1890c116d37b01b230112216b893efe57602a23.tar.gz
Make pagestats output more deterministic.
Sort in lexical order the pages that have the same number of hits.
-rw-r--r--IkiWiki/Plugin/pagestats.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm
index ac0a463e3..304ddd1c8 100644
--- a/IkiWiki/Plugin/pagestats.pm
+++ b/IkiWiki/Plugin/pagestats.pm
@@ -86,7 +86,7 @@ sub preprocess (@) {
if (exists $params{limit}) {
my $i=0;
my %show;
- foreach my $key (sort { $counts{$b} <=> $counts{$a} } keys %counts) {
+ foreach my $key (sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts) {
last if ++$i > $params{limit};
$show{$key}=$counts{$key};
}
@@ -100,7 +100,7 @@ sub preprocess (@) {
htmllink($params{page}, $params{destpage}, $_, noimageinline => 1, linktext => linktext($_, %params)).
"</td><td>".$counts{$_}."</td></tr>"
}
- sort { $counts{$b} <=> $counts{$a} } keys %counts).
+ sort { $counts{$b} <=> $counts{$a} || $a cmp $b } keys %counts).
"\n</table>\n" ;
}
else {