From: Dobrica Pavlinusic Date: Wed, 13 Mar 2013 09:34:10 +0000 (+0100) Subject: distinct on first author X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=15d484fdc0010544bb9185741652f140c6930264;p=angular-drzb distinct on first author --- diff --git a/angular-server.pl b/angular-server.pl index 94c84ad..e6298fc 100755 --- a/angular-server.pl +++ b/angular-server.pl @@ -296,7 +296,7 @@ function(doc) { } elsif ( $format eq 'key_distinct' ) { my $found; - $json->{rows} = [ grep { $found->{ $_->{key} }++ == 1 } @{ $json->{rows} } ]; + $json->{rows} = [ grep { ++$found->{ $_->{key} } == 1 } @{ $json->{rows} } ]; $json->{distinct_rows} = scalar @{ $json->{rows} }; warn "## distinct stats ", dump( $found );