Commit 2f0c3e32 authored by Tim Peters's avatar Tim Peters

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

elements.
parent 56649f61
......@@ -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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment