both loops ...

On Thu, Mar 26, 2015 at 6:20 AM, <humbed...@apache.org> wrote:

> Author: humbedooh
> Date: Thu Mar 26 11:20:28 2015
> New Revision: 1669322
>
> URL: http://svn.apache.org/r1669322
> Log:
> don't call nlargest on every turn, we don't need that
>
> Modified:
>     steve/trunk/pysteve/lib/plugins/fic.py
>
> Modified: steve/trunk/pysteve/lib/plugins/fic.py
> URL:
> http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/plugins/fic.py?rev=1669322&r1=1669321&r2=1669322&view=diff
>
> ==============================================================================
> --- steve/trunk/pysteve/lib/plugins/fic.py (original)
> +++ steve/trunk/pysteve/lib/plugins/fic.py Thu Mar 26 11:20:28 2015
> @@ -68,7 +68,8 @@ def tallyFIC(votes, issue):
>
>      # Start counting
>      sorted_matrix = sorted(matrix.items(), key=operator.itemgetter(1))
> -    winners = [l[0] for l in sorted_matrix if matrix[l[0]] in
> heapq.nlargest(numseats, matrix.values())]
> +    bignums = heapq.nlargest(numseats, matrix.values())
> +    winners = [l[0] for l in sorted_matrix if matrix[l[0]] in bignums]
>
>      # Compile list of winner names
>      winnernames = []
>
>
>

Reply via email to