8000 MAINT: Make the refactor suggested in prepare_index by eric-wieser · Pull Request #8278 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Make the refactor suggested in prepare_index #8278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 18, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! BUG: Fix reference counting
  • Loading branch information
eric-wieser committed Apr 9, 2017
commit 966b2c7e00d797d23740034cda691ee433743fef
6 changes: 2 additions & 4 deletions numpy/core/src/multiarray/mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ unpack_indices(PyObject *index, PyObject *result[2*NPY_MAXDIMS])
multi_DECREF(result, i);
return -1;
}
Py_INCREF(result[i]);
}
return n;
}
Expand Down Expand Up @@ -283,7 +282,6 @@ unpack_indices(PyObject *index, PyObject *result[2*NPY_MAXDIMS])
* unpacking
*/
if (tmp_obj == NULL) {
multi_DECREF(result, i);
PyErr_Clear();
break;
}
Expand All @@ -305,8 +303,8 @@ unpack_indices(PyObject *index, PyObject *result[2*NPY_MAXDIMS])
}
/* got to the end, never found an indication that we should have unpacked */
else {
/* we already filled result, so empty it first */
multi_DECREF(result, n);
/* we partially filled result, so empty it first */
multi_DECREF(result, i);

Py_INCREF(index);
result[0] = index;
Expand Down
0