Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r68442:92ff43b19372
Date: 2013-12-15 13:45 -0800
http://bitbucket.org/pypy/pypy/changeset/92ff43b19372/
Log: Replace a loop with a memcpy
diff --git a/pypy/module/_cffi_backend/cdataobj.py
b/pypy/module/_cffi_backend/cdataobj.py
--- a/pypy/module/_cffi_backend/cdataobj.py
+++ b/pypy/module/_cffi_backend/cdataobj.py
@@ -206,8 +206,7 @@
w_value.get_array_length() == length):
# fast path: copying from exactly the correct type
s = w_value._cdata
- for i in range(ctitemsize * length):
- cdata[i] = s[i]
+ rffi.c_memcpy(cdata, s, ctitemsize * length)
keepalive_until_here(w_value)
return
#
@@ -259,7 +258,6 @@
space = self.space
if isinstance(w_other, W_CData):
from pypy.module._cffi_backend import ctypeptr, ctypearray
- from pypy.module._cffi_backend import ctypevoid
ct = w_other.ctype
if isinstance(ct, ctypearray.W_CTypeArray):
ct = ct.ctptr
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit