Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r50007:925245546811
Date: 2011-11-30 12:09 +0100
http://bitbucket.org/pypy/pypy/changeset/925245546811/

Log:    Chanced upon a "x not in biglist" done in a loop: replace it with "x
        not in set".

diff --git a/pypy/translator/simplify.py b/pypy/translator/simplify.py
--- a/pypy/translator/simplify.py
+++ b/pypy/translator/simplify.py
@@ -424,6 +424,7 @@
     but not used in the target block. Input is a set of blocks"""
     read_vars = {}  # set of variables really used
     variable_flow = {}  # map {Var: list-of-Vars-it-depends-on}
+    set_of_blocks = set(blocks)
 
     def canremove(op, block):
         if op.opname not in CanRemove:
@@ -451,7 +452,7 @@
 
         if block.exits:
             for link in block.exits:
-                if link.target not in blocks:
+                if link.target not in set_of_blocks:
                     for arg, targetarg in zip(link.args, 
link.target.inputargs):
                         read_vars[arg] = True
                         read_vars[targetarg] = True
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to