Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix off-by-one error affecting pagination

This was reorganized in 9d60740.
The var comparison was moved to after the var was incremented
but the offset wasn't adjusted accordingly.

Closes gh-608.
... and all the duplicates.
  • Loading branch information...
commit 2ab339a4426f9628dd79444e28f731eba4465dfd 1 parent b01ebe3
@rwstauner rwstauner authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/MetaCPAN/Web/Model/API/Module.pm
View
3  lib/MetaCPAN/Web/Model/API/Module.pm
@@ -120,7 +120,8 @@ sub search_collapsed {
$run++;
} while ( @distributions < 20 + $from
&& $data->{hits}->{total}
- && $data->{hits}->{total} > $hits + ( $run - 1 ) * $RESULTS_PER_RUN );
+ && $data->{hits}->{total} > $hits + ( $run - 2 ) * $RESULTS_PER_RUN
+ );
@distributions = splice( @distributions, $from, 20 );
my $ratings = $self->model('Rating')->get(@distributions);
Please sign in to comment.
Something went wrong with that request. Please try again.