diff options
author | Arink Verma <arinkverma@gmail.com> | 2013-07-08 15:13:01 +0530 |
---|---|---|
committer | Arink Verma <arinkverma@gmail.com> | 2013-07-08 15:13:01 +0530 |
commit | 9b3e719b8ab153335bcc9064cf186c823367bdbe (patch) | |
tree | 10252da549dde9ef5d9b4dde4580b940773ff3b4 | |
parent | 55bc296b5b415f4ca575e9d17ff930b14a89306d (diff) | |
download | numpy-9b3e719b8ab153335bcc9064cf186c823367bdbe.tar.gz |
ENH: added check for scalar array in PyArray_FromArray from ctors.c
Check if object is of array dimension zero with newtype is NULL. If so return it directly instead of checking for casting.
-rw-r--r-- | numpy/core/src/umath/ufunc_type_resolution.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c index 3a08f2d55..6a16692b0 100644 --- a/numpy/core/src/umath/ufunc_type_resolution.c +++ b/numpy/core/src/umath/ufunc_type_resolution.c @@ -422,7 +422,6 @@ PyUFunc_SimpleBinaryOperationTypeResolver(PyUFuncObject *ufunc, */ type_num1 = PyArray_DESCR(operands[0])->type_num; type_num2 = PyArray_DESCR(operands[1])->type_num; - if (type_num1 >= NPY_NTYPES || type_num2 >= NPY_NTYPES || type_num1 == NPY_OBJECT || type_num2 == NPY_OBJECT) { return PyUFunc_DefaultTypeResolver(ufunc, casting, operands, @@ -432,7 +431,6 @@ PyUFunc_SimpleBinaryOperationTypeResolver(PyUFuncObject *ufunc, if (type_tup == NULL) { /* Input types are the result type */ out_dtypes[0] = PyArray_ResultType(2, operands, 0, NULL); - if (out_dtypes[0] == NULL) { return -1; } |