[Python-checkins] python/dist/src/Lib heapq.py,1.2,1.3
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Fri, 02 Aug 2002 12:16:46 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv27148/python/Lib
Modified Files:
heapq.py
Log Message:
Don't use true division where int division was intended. For that matter,
don't use division at all.
Index: heapq.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/heapq.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** heapq.py 2 Aug 2002 16:50:58 -0000 1.2
--- heapq.py 2 Aug 2002 19:16:44 -0000 1.3
***************
*** 127,131 ****
heap.append(None)
while pos:
! parentpos = (pos - 1) / 2
parent = heap[parentpos]
if item >= parent:
--- 127,131 ----
heap.append(None)
while pos:
! parentpos = (pos - 1) >> 1
parent = heap[parentpos]
if item >= parent: