[pypy-commit] pypy default: Use ll_arraycopy() instead of looping
arigo
pypy.commits at gmail.com
Sun Jun 5 08:23:22 EDT 2016
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r84935:da5b62f5d057
Date: 2016-06-05 14:24 +0200
http://bitbucket.org/pypy/pypy/changeset/da5b62f5d057/
Log: Use ll_arraycopy() instead of looping
diff --git a/rpython/rlib/rgc.py b/rpython/rlib/rgc.py
--- a/rpython/rlib/rgc.py
+++ b/rpython/rlib/rgc.py
@@ -1261,10 +1261,7 @@
length = ll_list.length
new_array = lltype.malloc(lltype.typeOf(ll_list).TO.items.TO, length,
nonmovable=True)
- i = 0
- while i < length:
- new_array[i] = array[i]
- i += 1
+ ll_arraycopy(array, new_array, 0, 0, length)
ll_list.items = new_array
array = new_array
ptr = lltype.direct_arrayitems(array)
More information about the pypy-commit
mailing list