[pypy-svn] r70889 - pypy/branch/unroll-safe-if-const-arg/pypy/objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Jan 26 16:26:22 CET 2010


Author: cfbolz
Date: Tue Jan 26 16:26:21 2010
New Revision: 70889

Modified:
   pypy/branch/unroll-safe-if-const-arg/pypy/objspace/std/formatting.py
Log:
this is on the silly side, but it helps the jit


Modified: pypy/branch/unroll-safe-if-const-arg/pypy/objspace/std/formatting.py
==============================================================================
--- pypy/branch/unroll-safe-if-const-arg/pypy/objspace/std/formatting.py	(original)
+++ pypy/branch/unroll-safe-if-const-arg/pypy/objspace/std/formatting.py	Tue Jan 26 16:26:21 2010
@@ -22,13 +22,12 @@
 
     def nextinputvalue(self):
         # return the next value in the tuple of input arguments
-        try:
-            w_result = self.values_w[self.values_pos]
-        except IndexError:
+        if self.values_pos >= len(self.values_w):
             space = self.space
             raise OperationError(space.w_TypeError, space.wrap(
                 'not enough arguments for format string'))
         else:
+            w_result = self.values_w[self.values_pos]
             self.values_pos += 1
             return w_result
 



More information about the Pypy-commit mailing list