mirror of
https://github.com/python/cpython
synced 2024-10-17 10:23:24 +00:00
_siftup(): __le__ is now the only comparison operator used on array
elements.
This commit is contained in:
parent
0ad679ff0f
commit
6681de2455
|
@ -233,7 +233,7 @@ def _siftup(heap, pos):
|
|||
while childpos < endpos:
|
||||
# Set childpos to index of smaller child.
|
||||
rightpos = childpos + 1
|
||||
if rightpos < endpos and heap[rightpos] < heap[childpos]:
|
||||
if rightpos < endpos and heap[rightpos] <= heap[childpos]:
|
||||
childpos = rightpos
|
||||
# Move the smaller child up.
|
||||
heap[pos] = heap[childpos]
|
||||
|
|
Loading…
Reference in a new issue