[pypy-svn] r76149 - pypy/branch/interplevel-array/pypy/module/array

hakanardo at codespeak.net hakanardo at codespeak.net
Mon Jul 12 16:31:55 CEST 2010


Author: hakanardo
Date: Mon Jul 12 16:31:54 2010
New Revision: 76149

Modified:
   pypy/branch/interplevel-array/pypy/module/array/interp_array.py
Log:
rpythonish

Modified: pypy/branch/interplevel-array/pypy/module/array/interp_array.py
==============================================================================
--- pypy/branch/interplevel-array/pypy/module/array/interp_array.py	(original)
+++ pypy/branch/interplevel-array/pypy/module/array/interp_array.py	Mon Jul 12 16:31:54 2010
@@ -364,8 +364,9 @@
             if mytype.bytes not in [1, 2, 4, 8]:
                 msg="byteswap not supported for this array"
                 raise OperationError(self.space.w_RuntimeError, self.space.wrap(msg))
+            if self.len == 0: return
             bytes = self.charbuf()
-            tmp = [0] * mytype.bytes
+            tmp = [bytes[0]] * mytype.bytes
             for start in range(0, self.len * mytype.bytes, mytype.bytes):
                 stop = start + mytype.bytes - 1
                 for i in range(mytype.bytes):



More information about the Pypy-commit mailing list