Skip to content

Commit 198df6b

Browse files
committed
Remove unnecessary dims array
1 parent 5fd9bc0 commit 198df6b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

numpy/_core/src/multiarray/iterators.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,7 @@ iter_subscript(PyArrayIterObject *self, PyObject *ind)
574574
NPY_cast_info cast_info = {.func = NULL};
575575

576576
/* Prepare the indices */
577-
npy_intp dims[1] = {self->size};
578-
index_type = prepare_index_noarray(1, dims, ind, indices, &index_num,
577+
index_type = prepare_index_noarray(1, &self->size, ind, indices, &index_num,
579578
&ndim, &fancy_ndim, 1, 1);
580579

581580
if (index_type < 0) {
@@ -652,7 +651,7 @@ iter_subscript(PyArrayIterObject *self, PyObject *ind)
652651

653652
if (index_type & HAS_SLICE) {
654653
if (PySlice_GetIndicesEx(indices[0].object,
655-
dims[0],
654+
self->size,
656655
&start, &stop, &step, &n_steps) < 0) {
657656
goto finish;
658657
}
@@ -834,8 +833,7 @@ iter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val)
834833
NPY_cast_info cast_info = {.func = NULL};
835834

836835
/* Prepare the indices */
837-
npy_intp dims[1] = {self->size};
838-
index_type = prepare_index_noarray(1, dims, ind, indices, &index_num,
836+
index_type = prepare_index_noarray(1, &self->size, ind, indices, &index_num,
839837
&ndim, &fancy_ndim, 1, 1);
840838

841839
if (index_type < 0) {
@@ -915,7 +913,7 @@ iter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val)
915913

916914
if (index_type & HAS_SLICE) {
917915
if (PySlice_GetIndicesEx(indices[0].object,
918-
dims[0],
916+
self->size,
919917
&start, &stop, &step, &n_steps) < 0) {
920918
goto finish;
921919
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy