diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-05-26 17:08:27 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2013-05-28 20:27:34 +0200 |
commit | 19e05629b42ec73b48237c186c2475b7c80fa5cc (patch) | |
tree | 64f7e57b6b8cbc7a507d9d58d4de3769d49fc7ef /numpy/lib/utils.py | |
parent | fae8369fba4a683783280b044915b11bbca07a44 (diff) | |
download | numpy-19e05629b42ec73b48237c186c2475b7c80fa5cc.tar.gz |
ENH: improve performance of byte_bounds for continous arrays
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 0e4300585..f19a47176 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -250,12 +250,11 @@ def byte_bounds(a): a_data = ai['data'][0] astrides = ai['strides'] ashape = ai['shape'] - nd_a = len(ashape) bytes_a = int(ai['typestr'][2:]) a_low = a_high = a_data if astrides is None: # contiguous case - a_high += product(ashape, dtype=int)*bytes_a + a_high += a.size * bytes_a else: for shape, stride in zip(ashape, astrides): if stride < 0: |