From 19e05629b42ec73b48237c186c2475b7c80fa5cc Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Sun, 26 May 2013 17:08:27 +0200 Subject: ENH: improve performance of byte_bounds for continous arrays --- numpy/lib/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/lib/utils.py') 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: -- cgit v1.2.1