8000 MAINT: Simplify code path slightly · numpy/numpy@d02ca96 · GitHub
[go: up one dir, main page]

Skip to content

Commit d02ca96

Browse files
committed
MAINT: Simplify code path slightly
1 parent 09934b2 commit d02ca96

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

numpy/core/src/multiarray/buffer.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ _buffer_get_info(PyObject *obj, int flags)
637637
item = PyList_GetItem(item_list, item_list_length - 1);
638638
old_info = (_buffer_info_t*)PyLong_AsVoidPtr(item);
639639
if (_buffer_info_cmp(info, old_info) != 0) {
640+
old_info = NULL; /* Can't use this one, but possibly next */
641+
640642
if (item_list_length > 1 && info->ndim > 1) {
641643
/*
642644
* Some arrays are C- and F-contiguous and if they have more
@@ -654,9 +656,6 @@ _buffer_get_info(PyObject *obj, int flags)
654656
old_info = NULL;
655657
}
656658
}
657-
else {
658-
old_info = NULL;
659-
}
660659
}
661660

662661
if (old_info != NULL) {

0 commit comments

Comments
 (0)
0