Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
uniq dist names, not array refs
  • Loading branch information
haarg committed Nov 19, 2016
1 parent 91f635f commit 6f1f318
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Web/Model/API/Module.pm
Expand Up @@ -124,14 +124,14 @@ sub search_collapsed {
if ( $run == 1 );
$hits = @{ $data->{hits}->{hits} || [] };
@distributions = uniq( @distributions,
map { $_->{fields}->{distribution} } @{ $data->{hits}->{hits} } );
map { $_->{fields}->{distribution}->[0] } @{ $data->{hits}->{hits} } );
$run++;
} while ( @distributions < $page_size + $from
&& $data->{hits}->{total}
&& $data->{hits}->{total} > $hits + ( $run - 2 ) * $RESULTS_PER_RUN );

@distributions
= map { $_->[0] } splice( @distributions, $from, $page_size );
= splice( @distributions, $from, $page_size );

# Everything else will fail (slowly and quietly) without distributions.
if ( !@distributions ) {
Expand Down

0 comments on commit 6f1f318

Please sign in to comment.