[pypy-commit] pypy python-loop-unroll: make sure order of operations is correct

alex_gaynor noreply at buildbot.pypy.org
Wed May 29 01:53:08 CEST 2013


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: python-loop-unroll
Changeset: r64654:b0325fcc2553
Date: 2013-05-28 16:52 -0700
http://bitbucket.org/pypy/pypy/changeset/b0325fcc2553/

Log:	make sure order of operations is correct

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -880,7 +880,7 @@
         from pypy.module.__pypy__.interp_unroll import W_LoopUnroller
         w_iterable = self.popvalue()
         length_hint = self.space.length_hint(w_iterable, sys.maxint)
-        if isinstance(w_iterable, W_LoopUnroller) or jit.isconstant(length_hint) and length_hint < 20:
+        if (jit.isconstant(length_hint) and length_hint < 20) or isinstance(w_iterable, W_LoopUnroller):
             lastblock = self.lastblock
             # This is the case for comprehensions, which don't add a frame
             # block, annoying (for now ignore the problem).


More information about the pypy-commit mailing list