diff options
author | Jay Bourque <jay.bourque@continuum.io> | 2013-03-27 17:32:03 -0500 |
---|---|---|
committer | Jay Bourque <jay.bourque@continuum.io> | 2013-08-16 16:39:31 -0500 |
commit | 45419ea12cca9d29d874620495319307b4dec6f4 (patch) | |
tree | 529f760218b2e9e73d045cb8a793d596e03ce9f0 /numpy | |
parent | 13c1847ba2f0eab36004491deb0e2b8e1140c133 (diff) | |
download | numpy-45419ea12cca9d29d874620495319307b4dec6f4.tar.gz |
Replace calls to New/Bind/Reset with MapIterArray
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/mapping.c | 6 | ||||
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 8 |
2 files changed, 2 insertions, 12 deletions
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c index 5a047ee88..c838a2ce6 100644 --- a/numpy/core/src/multiarray/mapping.c +++ b/numpy/core/src/multiarray/mapping.c @@ -1653,7 +1653,6 @@ _convert_obj(PyObject *obj, PyArrayIterObject **iter) } /* Reset the map iterator to the beginning */ -/*NUMPY_API*/ NPY_NO_EXPORT void PyArray_MapIterReset(PyArrayMapIterObject *mit) { @@ -1699,11 +1698,10 @@ PyArray_MapIterReset(PyArrayMapIterObject *mit) return; } -/* +/*NUMPY_API * This function needs to update the state of the map iterator * and point mit->dataptr to the memory-location of the next object */ -/*NUMPY_API*/ NPY_NO_EXPORT void PyArray_MapIterNext(PyArrayMapIterObject *mit) { @@ -1770,7 +1768,6 @@ PyArray_MapIterNext(PyArrayMapIterObject *mit) * Let's do it at bind time and also convert all <0 values to >0 here * as well. */ -/*NUMPY_API*/ NPY_NO_EXPORT int PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr) { @@ -1966,7 +1963,6 @@ PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr) } -/*NUMPY_API*/ NPY_NO_EXPORT PyObject * PyArray_MapIterNew(PyObject *indexobj, int oned, int fancy) { diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index dadf86e28..cd6a6d44d 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -4913,17 +4913,11 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds) goto fail; } - iter = (PyArrayMapIterObject*)PyArray_MapIterNew(idx, 0, 1); + iter = PyArray_MapIterArray(op1_array, idx); if (iter == NULL) { goto fail; } - PyArray_MapIterBind(iter, op1_array); - if (iter->ait == NULL) { - goto fail; - } - PyArray_MapIterReset(iter); - /* * If second operand exists, we need to broadcast it to * the shape of the indices applied to the first operand. |