[pypy-svn] r72139 - pypy/trunk/pypy/interpreter

fijal at codespeak.net fijal at codespeak.net
Thu Mar 11 22:18:07 CET 2010


Author: fijal
Date: Thu Mar 11 22:18:06 2010
New Revision: 72139

Modified:
   pypy/trunk/pypy/interpreter/nestedscope.py
Log:
avoid pointless copy in case we don't have anything to add


Modified: pypy/trunk/pypy/interpreter/nestedscope.py
==============================================================================
--- pypy/trunk/pypy/interpreter/nestedscope.py	(original)
+++ pypy/trunk/pypy/interpreter/nestedscope.py	Thu Mar 11 22:18:06 2010
@@ -101,7 +101,9 @@
         if len(closure) != nfreevars:
             raise ValueError("code object received a closure with "
                                  "an unexpected number of free variables")
-        self.cells = [Cell() for i in range(ncellvars)] + closure
+        self.cells = [Cell() for i in range(ncellvars)]
+        if closure:
+            self.cells += closure
 
     def getclosure(self):
         if self.cells is None:



More information about the Pypy-commit mailing list