Author: Maciej Fijalkowski <[email protected]>
Branch: rdict-experiments
Changeset: r59693:bbda3b169422
Date: 2013-01-04 12:31 +0200
http://bitbucket.org/pypy/pypy/changeset/bbda3b169422/

Log:    use ll_arraycopy

diff --git a/pypy/rlib/dict.py b/pypy/rlib/dict.py
--- a/pypy/rlib/dict.py
+++ b/pypy/rlib/dict.py
@@ -1,5 +1,6 @@
 
 from pypy.rlib.jit_hooks import _cast_to_gcref
+from pypy.rlib import rgc
 from pypy.rpython.lltypesystem import lltype, llmemory, rclass
 from pypy.rpython.annlowlevel import cast_base_ptr_to_instance
 
@@ -79,9 +80,7 @@
         self.filled = self.used
         old_values = self.values
         self.values = lltype.malloc(TP, new_size * 2 / 3 + 1)
-        for i in range(self.used):
-            self.values[i].key = old_values[i].key
-            self.values[i].value = old_values[i].value
+        rgc.ll_arraycopy(old_values, self.values, 0, 0, self.used)
 
     def clear(self):
         self.indices = self._make_index(8)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to