_siftup(): __le__ is now the only comparison operator used on array

elements.
This commit is contained in:
Tim Peters 2002-08-03 19:20:16 +00:00
parent 0ad679ff0f
commit 6681de2455

View file

@ -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]