[pypy-svn] r10592 - pypy/dist/pypy/translator

tismer at codespeak.net tismer at codespeak.net
Wed Apr 13 20:11:17 CEST 2005


Author: tismer
Date: Wed Apr 13 20:11:16 2005
New Revision: 10592

Modified:
   pypy/dist/pypy/translator/geninterplevel.py
Log:
try to always save at least one list entry assignment.
If we are lucky, we get them all at once.

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Wed Apr 13 20:11:16 2005
@@ -746,8 +746,9 @@
         name = self.uniquename('g%dlist' % len(lis))
         # note that self.latercode led to too late initialization.
         self.register_early(lis, name)
-        if lis and min(lis) is max(lis) and min(lis) not in lis:
-            default = min(lis)
+        # try to save at least one assignment.
+        if lis and lis[0] not in lis:
+            default = lis[0]
         else:
             default = None
         self.initcode.append('%s = space.newlist([%s])' % (name, self.nameof(default)))



More information about the Pypy-commit mailing list