summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2023-01-03 14:21:58 +0200
committermattip <matti.picus@gmail.com>2023-01-03 14:21:58 +0200
commit17388bb13bca084679e9680cf49999c4c3388983 (patch)
tree241587592b3e89edbddd11ac9061261dc0fcc496
parentbe77b8fd088c1c4547354975daf17bba8fde295e (diff)
downloadnumpy-17388bb13bca084679e9680cf49999c4c3388983.tar.gz
MAINT: remove overly-cautious check (from review)
-rw-r--r--numpy/core/src/umath/ufunc_object.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index a5030c95d..79af0837b 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -6415,29 +6415,23 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
goto fail;
}
int fast_path = 1;
- for (int i=0; i<3; i++) {
- /* over-cautious? Only use built-in numeric dtypes */
- if (operation_descrs[i] && !PyDataType_ISNUMBER(operation_descrs[i])) {
+ /* check no casting, alignment */
+ if (PyArray_DESCR(op1_array) != operation_descrs[0]) {
fast_path = 0;
- }
}
- if (fast_path == 1) {
- /* check no casting, alignment */
- if (PyArray_DESCR(op1_array) != operation_descrs[0]) {
- fast_path = 0;
- }
- if (!PyArray_ISALIGNED(op1_array)) {
- fast_path = 0;
- }
- if (nop >2 && PyArray_DESCR(op2_array) != operation_descrs[1]) {
- fast_path = 0;
+ if (!PyArray_ISALIGNED(op1_array)) {
+ fast_path = 0;
+ }
+ if (nop >2) {
+ if (PyArray_DESCR(op2_array) != operation_descrs[1]) {
+ fast_path = 0;
}
- if (nop > 2 && !PyArray_ISALIGNED(op2_array)) {
+ if (!PyArray_ISALIGNED(op2_array)) {
fast_path = 0;
}
}
if (fast_path == 1) {
- res = ufunc_at__fast_iter(ufunc, flags, iter, iter2, op1_array, op2_array,
+ res = ufunc_at__fast_iter(ufunc, flags, iter, iter2, op1_array, op2_array,
strided_loop, &context, strides, auxdata);
} else {
res = ufunc_at__slow_iter(ufunc, flags, iter, iter2, op1_array, op2_array,