Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit75aaed0

Browse files
committed
Remove unnecessary dims array
1 parentf9c2351 commit75aaed0

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_infocast_info= {.func=NULL};
575575

576576
/* Prepare the indices */
577-
npy_intpdims[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
gotofinish;
658657
}
@@ -834,8 +833,7 @@ iter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val)
834833
NPY_cast_infocast_info= {.func=NULL};
835834

836835
/* Prepare the indices */
837-
npy_intpdims[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
gotofinish;
921919
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp