Commits

Alex Gaynor  committed 1d664ad

rewrite list inplace mul in terms of ll_arraycopy, less code and probably faster

  • Participants
  • Parent commits 0d09209

Comments (0)

Files changed (1)

File rpython/rtyper/rlist.py

     res._ll_resize(resultlen)
     j = length
     while j < resultlen:
-        i = 0
-        while i < length:
-            p = j + i
-            res.ll_setitem_fast(p, l.ll_getitem_fast(i))
-            i += 1
+        ll_arraycopy(l, res, 0, j, length)
         j += length
     return res
 ll_inplace_mul.oopspec = 'list.inplace_mul(l, factor)'