[pypy-svn] pypy default: change a pair of range to xrange, to remove 1 guard each during annotation

alex_gaynor commits-noreply at bitbucket.org
Tue Mar 22 06:03:39 CET 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r42838:c35afc91f814
Date: 2011-03-22 01:03 -0400
http://bitbucket.org/pypy/pypy/changeset/c35afc91f814/

Log:	change a pair of range to xrange, to remove 1 guard each during
	annotation

diff --git a/pypy/objspace/std/multimethod.py b/pypy/objspace/std/multimethod.py
--- a/pypy/objspace/std/multimethod.py
+++ b/pypy/objspace/std/multimethod.py
@@ -516,7 +516,7 @@
         test = 1
         while True:
             self.ensure_length(test+len(array))
-            for i in range(len(array)):
+            for i in xrange(len(array)):
                 if not (array[i] == self.items[test+i] or
                         array[i] == self.null_value or
                         self.items[test+i] == self.null_value):

diff --git a/pypy/objspace/flow/framestate.py b/pypy/objspace/flow/framestate.py
--- a/pypy/objspace/flow/framestate.py
+++ b/pypy/objspace/flow/framestate.py
@@ -169,7 +169,7 @@
             lst[i:i+1] = [tag] + vars
 
 def recursively_unflatten(space, lst):
-    for i in range(len(lst)-1, -1, -1):
+    for i in xrange(len(lst)-1, -1, -1):
         item = lst[i]
         if item in UNPICKLE_TAGS:
             unrollerclass, argcount = UNPICKLE_TAGS[item]


More information about the Pypy-commit mailing list