Skip to content

Commit dea1835

Browse files
committed
fix index update
1 parent 62bf9c2 commit dea1835

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/itertoolsmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,9 @@ cycle_next(PyObject *op)
12241224
item = PyList_GET_ITEM(lz->saved, index);
12251225
index++;
12261226
if (index >= PyList_GET_SIZE(lz->saved)) {
1227-
FT_ATOMIC_STORE_SSIZE_RELAXED(lz->index, 0);
1227+
index = 0;
12281228
}
1229+
FT_ATOMIC_STORE_SSIZE_RELAXED(lz->index, index);
12291230
return Py_NewRef(item);
12301231
}
12311232

0 commit comments

Comments
 (0)