diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-10-22 15:07:38 -0500 |
|---|---|---|
| committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-10-22 15:09:01 -0500 |
| commit | d02ca96090ea2fed97b7789a855668c1ddc98294 (patch) | |
| tree | 07013d92128bd107d84624617da98768c0d68710 /numpy | |
| parent | 09934b2b5227cdc9b9f28dc5d719dbc515cbe69e (diff) | |
| download | numpy-d02ca96090ea2fed97b7789a855668c1ddc98294.tar.gz | |
MAINT: Simplify code path slightly
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/multiarray/buffer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c index 5ba343d6d..3b3bba663 100644 --- a/numpy/core/src/multiarray/buffer.c +++ b/numpy/core/src/multiarray/buffer.c @@ -637,6 +637,8 @@ _buffer_get_info(PyObject *obj, int flags) item = PyList_GetItem(item_list, item_list_length - 1); old_info = (_buffer_info_t*)PyLong_AsVoidPtr(item); if (_buffer_info_cmp(info, old_info) != 0) { + old_info = NULL; /* Can't use this one, but possibly next */ + if (item_list_length > 1 && info->ndim > 1) { /* * Some arrays are C- and F-contiguous and if they have more @@ -654,9 +656,6 @@ _buffer_get_info(PyObject *obj, int flags) old_info = NULL; } } - else { - old_info = NULL; - } } if (old_info != NULL) { |
