summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-07-24 16:33:09 -0500
committerGitHub <noreply@github.com>2017-07-24 16:33:09 -0500
commitf3e4a44c43dd5b1adc9f003071badca7f294eceb (patch)
treeb96b35a29007f23755371a516c94d31b54ce24f9 /numpy
parentd75b86c0c49f7eb3ec60564c2e23b3ff237082a2 (diff)
parent0168d793795d27cb4381ed2eaab278536985bba9 (diff)
downloadnumpy-f3e4a44c43dd5b1adc9f003071badca7f294eceb.tar.gz
Merge pull request #9454 from eric-wieser/remove-pointless-code
MAINT: Remove branch in __array__ where if and else were the same
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/methods.c22
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;
}