]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchview: minor cleanup
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 5 Apr 2018 09:34:10 +0000 (09:34 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 5 Apr 2018 10:27:13 +0000 (10:27 +0000)
$mset->size is probably more obvious than relying on a tied
array and saves us a line.

lib/PublicInbox/SearchView.pm

index c78979582432d97856a9d5690d7a98c90646732d..d038dfcac761912f9338783be5ea164469dcbdf7 100644 (file)
@@ -180,9 +180,8 @@ sub search_nav_top {
 sub search_nav_bot {
        my ($mset, $q) = @_;
        my $total = $mset->get_matches_estimated;
 sub search_nav_bot {
        my ($mset, $q) = @_;
        my $total = $mset->get_matches_estimated;
-       my $nr = scalar $mset->items;
        my $o = $q->{o};
        my $o = $q->{o};
-       my $end = $o + $nr;
+       my $end = $o + $mset->size;
        my $beg = $o + 1;
        my $rv = '</pre><hr><pre id=t>';
        if ($beg <= $end) {
        my $beg = $o + 1;
        my $rv = '</pre><hr><pre id=t>';
        if ($beg <= $end) {