[pypy-commit] pypy speedup-list-comprehension: oops, a missing case

fijal noreply at buildbot.pypy.org
Thu Feb 23 16:40:51 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: speedup-list-comprehension
Changeset: r52810:de49996d2864
Date: 2012-02-23 08:40 -0700
http://bitbucket.org/pypy/pypy/changeset/de49996d2864/

Log:	oops, a missing case

diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -663,6 +663,8 @@
         w_list.lstorage = self.erase(l)
 
     def get_empty_storage(self, sizehint):
+        if sizehint == -1:
+            return self.erase([])
         return self.erase(newlist(sizehint))
 
     def clone(self, w_list):


More information about the pypy-commit mailing list