1. Pypy
  2. Untitled project
  3. pypy

Commits

Philip Jenvey  committed 5ec2216

(fijal) don't overalloc in resizelist_hint ge

  • Participants
  • Parent commits 108124b
  • Branches length-hint

Comments (0)

Files changed (1)

File pypy/rpython/lltypesystem/rlist.py

View file
     guess lied).
     """
     allocated = len(l.items)
-    if allocated < newsize:
-        _ll_list_resize_hint_really(l, newsize, True)
-    elif newsize < (allocated >> 1) - 5:
+    if allocated < newsize or newsize < (allocated >> 1) - 5:
         _ll_list_resize_hint_really(l, newsize, False)
 
 @enforceargs(None, int, None)