From: Tim Peters Date: Sat, 3 Aug 2002 19:20:16 +0000 (+0000) Subject: _siftup(): __le__ is now the only comparison operator used on array X-Git-Tag: v2.3c1~4743 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6681de2455f8d43de9cb22ddaf6a155c63af81c3;p=python _siftup(): __le__ is now the only comparison operator used on array elements. --- diff --git a/Lib/heapq.py b/Lib/heapq.py index 23f8be54fa..47326f3606 100644 --- a/Lib/heapq.py +++ b/Lib/heapq.py @@ -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]