Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r60460:1d664ad717ce
Date: 2013-01-25 10:35 -0600
http://bitbucket.org/pypy/pypy/changeset/1d664ad717ce/
Log: rewrite list inplace mul in terms of ll_arraycopy, less code and
probably faster
diff --git a/rpython/rtyper/rlist.py b/rpython/rtyper/rlist.py
--- a/rpython/rtyper/rlist.py
+++ b/rpython/rtyper/rlist.py
@@ -1025,11 +1025,7 @@
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)'
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit