[Python-checkins] python/dist/src/Lib/test test_heapq.py,1.1,1.2

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年8月02日 12:16:46 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv27148/python/Lib/test
Modified Files:
	test_heapq.py 
Log Message:
Don't use true division where int division was intended. For that matter,
don't use division at all.
Index: test_heapq.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_heapq.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_heapq.py	2 Aug 2002 18:29:53 -0000	1.1
--- test_heapq.py	2 Aug 2002 19:16:44 -0000	1.2
***************
*** 9,13 ****
 # Check the heap invariant.
 for pos, item in enumerate(heap):
! parentpos = (pos+1)/2 - 1
 if parentpos >= 0:
 verify(heap[parentpos] <= item)
--- 9,13 ----
 # Check the heap invariant.
 for pos, item in enumerate(heap):
! parentpos = ((pos+1) >> 1) - 1
 if parentpos >= 0:
 verify(heap[parentpos] <= item)

AltStyle によって変換されたページ (->オリジナル) /