summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/common.h b/numpy/core/src/multiarray/common.h
index 43c6dc386..ff1d4ec77 100644
--- a/numpy/core/src/multiarray/common.h
+++ b/numpy/core/src/multiarray/common.h
@@ -75,7 +75,7 @@ static NPY_INLINE int
check_and_adjust_index(npy_intp *index, npy_intp max_item, int axis)
{
/* Check that index is valid, taking into account negative indices */
- if ((*index < -max_item) || (*index >= max_item)) {
+ if (NPY_UNLIKELY((*index < -max_item) || (*index >= max_item))) {
/* Try to be as clear as possible about what went wrong. */
if (axis >= 0) {
PyErr_Format(PyExc_IndexError,