[pypy-svn] r71118 - pypy/trunk/pypy/lib/_ctypes

afa at codespeak.net afa at codespeak.net
Fri Feb 5 17:54:55 CET 2010


Author: afa
Date: Fri Feb  5 17:54:53 2010
New Revision: 71118

Modified:
   pypy/trunk/pypy/lib/_ctypes/array.py
Log:
Considerable speed-up of the c_char_Array.raw getter


Modified: pypy/trunk/pypy/lib/_ctypes/array.py
==============================================================================
--- pypy/trunk/pypy/lib/_ctypes/array.py	(original)
+++ pypy/trunk/pypy/lib/_ctypes/array.py	Fri Feb  5 17:54:53 2010
@@ -36,7 +36,8 @@
                 res.value = property(getvalue, setvalue)
 
                 def getraw(self):
-                    return "".join([self[i] for i in range(self._length_)])
+                    return rawffi.charp2rawstring(self._buffer.buffer,
+                                                  self._length_)
 
                 def setraw(self, buffer):
                     for i in range(len(buffer)):



More information about the Pypy-commit mailing list