提交 bcada063 authored 作者: seberg's avatar seberg

MAINT: Remove unnecessary check from before swapaxes (API change)

This check was a speed optimization in the numpy code. Due to a small change in the MapIter API, the check is now wrong in corner cases and becomes fully unnecessary. The previous API had not been public in any release numpy version.
上级 dc5617c1
...@@ -117,11 +117,9 @@ map_increment(PyArrayMapIterObject *mit, PyObject *op, inplace_map_binop add_inp ...@@ -117,11 +117,9 @@ map_increment(PyArrayMapIterObject *mit, PyObject *op, inplace_map_binop add_inp
return -1; return -1;
} }
if ((mit->subspace != NULL) && (mit->consec)) { if ((mit->subspace != NULL) && (mit->consec)) {
if (mit->iteraxes[0] > 0) { PyArray_MapIterSwapAxes(mit, (PyArrayObject **)&arr, 0);
PyArray_MapIterSwapAxes(mit, (PyArrayObject **)&arr, 0); if (arr == NULL) {
if (arr == NULL) { return -1;
return -1;
}
} }
} }
it = (PyArrayIterObject*) it = (PyArrayIterObject*)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论