[pypy-svn] r25355 - pypy/branch/explicit-exceptions/objspace/flow

mwh at codespeak.net mwh at codespeak.net
Wed Apr 5 13:12:57 CEST 2006


Author: mwh
Date: Wed Apr  5 13:12:56 2006
New Revision: 25355

Modified:
   pypy/branch/explicit-exceptions/objspace/flow/model.py
Log:
merging of http://codespeak.net/svn/pypy/dist/pypy/objspace/flow/model.py
revisions 24785 to 25354:

    ------------------------------------------------------------------------
    r24794 | mwh | 2006-03-22 13:34:35 +0100 (Wed, 22 Mar 2006) | 4 lines
    
    don't use id dictionaries in iterlinks(), itergraphs(), Blocks don't define
    __eq__ or __cmp__ so there's no need.  Also, not doing so is ever-so-slightly
    quicker.
    
    ------------------------------------------------------------------------


Modified: pypy/branch/explicit-exceptions/objspace/flow/model.py
==============================================================================
--- pypy/branch/explicit-exceptions/objspace/flow/model.py	(original)
+++ pypy/branch/explicit-exceptions/objspace/flow/model.py	Wed Apr  5 13:12:56 2006
@@ -77,25 +77,25 @@
     def iterblocks(self):
         block = self.startblock
         yield block
-        seen = {id(block): True}
+        seen = {block: True}
         stack = list(block.exits[::-1])
         while stack:
             block = stack.pop().target
-            if id(block) not in seen:
+            if block not in seen:
                 yield block
-                seen[id(block)] = True
+                seen[block] = True
                 stack += block.exits[::-1]
 
     def iterlinks(self):
         block = self.startblock
-        seen = {id(block): True}
+        seen = {block: True}
         stack = list(block.exits[::-1])
         while stack:
             link = stack.pop()
             yield link
             block = link.target
-            if id(block) not in seen:
-                seen[id(block)] = True
+            if block not in seen:
+                seen[block] = True
                 stack += block.exits[::-1]
 
     def show(self):



More information about the Pypy-commit mailing list