mirror of https://github.com/python/cpython
I believe the intention here was to avoid a global lookup
This commit is contained in:
parent
4829136965
commit
fb921e2c00
|
@ -195,7 +195,7 @@ def nlargest(n, iterable):
|
||||||
heapify(result)
|
heapify(result)
|
||||||
_heappushpop = heappushpop
|
_heappushpop = heappushpop
|
||||||
for elem in it:
|
for elem in it:
|
||||||
heappushpop(result, elem)
|
_heappushpop(result, elem)
|
||||||
result.sort(reverse=True)
|
result.sort(reverse=True)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue