[pypy-commit] pypy default: some optimizations for arange

bdkearns noreply at buildbot.pypy.org
Fri Oct 10 07:22:40 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r73879:3245cfc8a14a
Date: 2014-10-10 01:14 -0400
http://bitbucket.org/pypy/pypy/changeset/3245cfc8a14a/

Log:	some optimizations for arange

diff --git a/pypy/module/micronumpy/app_numpy.py b/pypy/module/micronumpy/app_numpy.py
--- a/pypy/module/micronumpy/app_numpy.py
+++ b/pypy/module/micronumpy/app_numpy.py
@@ -16,9 +16,9 @@
         dtype = test.dtype
     length = math.ceil((float(stop) - start) / step)
     length = int(length)
-    arr = _numpypy.multiarray.zeros(length, dtype=dtype)
+    arr = _numpypy.multiarray.empty(length, dtype=dtype)
     i = start
-    for j in range(arr.size):
+    for j in xrange(arr.size):
         arr[j] = i
         i += step
     return arr


More information about the pypy-commit mailing list