diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-07-24 17:33:20 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-07-24 17:33:20 +0100 |
commit | 0168d793795d27cb4381ed2eaab278536985bba9 (patch) | |
tree | 825a32d58e93ef0ead94b6005138cdefb5172de6 | |
parent | 6958be1c9180bd52a7aaf979718b2b851f280055 (diff) | |
download | numpy-0168d793795d27cb4381ed2eaab278536985bba9.tar.gz |
MAINT: Remove branch in __array__ where if and else were the same
-rw-r--r-- | numpy/core/src/multiarray/methods.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c index ffccf4e05..8328d2853 100644 --- a/numpy/core/src/multiarray/methods.c +++ b/numpy/core/src/multiarray/methods.c @@ -973,20 +973,18 @@ array_getarray(PyArrayObject *self, PyObject *args) /* convert to PyArray_Type */ if (!PyArray_CheckExact(self)) { PyArrayObject *new; - PyTypeObject *subtype = &PyArray_Type; - - if (!PyType_IsSubtype(Py_TYPE(self), &PyArray_Type)) { - subtype = &PyArray_Type; - } Py_INCREF(PyArray_DESCR(self)); - new = (PyArrayObject *)PyArray_NewFromDescr(subtype, - PyArray_DESCR(self), - PyArray_NDIM(self), - PyArray_DIMS(self), - PyArray_STRIDES(self), - PyArray_DATA(self), - PyArray_FLAGS(self), NULL); + new = (PyArrayObject *)PyArray_NewFromDescr( + &PyArray_Type, + PyArray_DESCR(self), + PyArray_NDIM(self), + PyArray_DIMS(self), + PyArray_STRIDES(self), + PyArray_DATA(self), + PyArray_FLAGS(self), + NULL + ); if (new == NULL) { return NULL; } |