Skip to content

Commit 0bcde5c

Browse files
simplify array_arrayiterator___reduce___impl
1 parent c0799be commit 0bcde5c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Modules/arraymodule.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3302,17 +3302,11 @@ array_arrayiterator___reduce___impl(arrayiterobject *self, PyTypeObject *cls)
33023302
array_state *state = get_array_state_by_class(cls);
33033303
assert(state != NULL);
33043304
PyObject *func = _PyEval_GetBuiltin(state->str_iter);
3305-
PyObject *ret = NULL;
33063305
Py_ssize_t index = FT_ATOMIC_LOAD_SSIZE_RELAXED(self->index);
33073306
if (index >= 0) {
3308-
if (index <= Py_SIZE(self->ao)) {
3309-
ret = Py_BuildValue("N(O)n", func, self->ao, index);
3310-
}
3311-
}
3312-
if (ret == NULL) {
3313-
ret = Py_BuildValue("N(())", func);
3307+
return Py_BuildValue("N(O)n", func, self->ao, index);
33143308
}
3315-
return ret;
3309+
return Py_BuildValue("N(())", func);
33163310
}
33173311

33183312
/*[clinic input]

0 commit comments

Comments
 (0)