]> granicus.if.org Git - python/commitdiff
_siftup(): __le__ is now the only comparison operator used on array
authorTim Peters <tim.peters@gmail.com>
Sat, 3 Aug 2002 19:20:16 +0000 (19:20 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 3 Aug 2002 19:20:16 +0000 (19:20 +0000)
elements.

Lib/heapq.py

index 23f8be54fad60881dfda7f461d3fb47498703fbf..47326f360680e3b4fce22255baddec77088fc6a4 100644 (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]