mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
_siftup(): __le__ is now the only comparison operator used on array
elements.
This commit is contained in:
parent
0ad679ff0f
commit
6681de2455
1 changed files with 1 additions and 1 deletions
|
@ -233,7 +233,7 @@ def _siftup(heap, pos):
|
||||||
while childpos < endpos:
|
while childpos < endpos:
|
||||||
# Set childpos to index of smaller child.
|
# Set childpos to index of smaller child.
|
||||||
rightpos = childpos + 1
|
rightpos = childpos + 1
|
||||||
if rightpos < endpos and heap[rightpos] < heap[childpos]:
|
if rightpos < endpos and heap[rightpos] <= heap[childpos]:
|
||||||
childpos = rightpos
|
childpos = rightpos
|
||||||
# Move the smaller child up.
|
# Move the smaller child up.
|
||||||
heap[pos] = heap[childpos]
|
heap[pos] = heap[childpos]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue