We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2037e3d commit 65daaeeCopy full SHA for 65daaee
1 file changed
Modules/itertoolsmodule.c
@@ -3634,9 +3634,10 @@ repeat_next(PyObject *op)
3634
if (cnt == 0) {
3635
return NULL;
3636
}
3637
- cnt--;
3638
- assert(cnt >=0);
3639
- FT_ATOMIC_STORE_SSIZE_RELAXED(ro->cnt, cnt);
+ if (cnt > 0) {
+ cnt--;
+ FT_ATOMIC_STORE_SSIZE_RELAXED(ro->cnt, cnt);
3640
+ }
3641
return Py_NewRef(ro->element);
3642
3643
0 commit comments