commit | 6681de2455f8d43de9cb22ddaf6a155c63af81c3 | [log] [tgz] |
---|---|---|
author | Tim Peters <tim.peters@gmail.com> | Sat Aug 03 19:20:16 2002 +0000 |
committer | Tim Peters <tim.peters@gmail.com> | Sat Aug 03 19:20:16 2002 +0000 |
tree | 673fa95bd2bb4149ffbb852973e0ee3a1a987943 | |
parent | 0ad679ff0f014c3c29fb839f33c027d7d928a09a [diff] |
_siftup(): __le__ is now the only comparison operator used on array elements.
diff --git a/Lib/heapq.py b/Lib/heapq.py index 23f8be5..47326f3 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py
@@ -233,7 +233,7 @@ 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]