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 e3a54be commit 9983345Copy full SHA for 9983345
Modules/itertoolsmodule.c
@@ -550,13 +550,15 @@ groupby_next(PyObject *op)
550
551
/* Hold strong references during comparison to prevent re-entrant __eq__
552
from advancing the iterator and invalidating borrowed references. */
553
- Py_INCREF(gbo -> tgtkey);
554
- Py_INCREF(gbo -> currkey);
+ PyObject *tgtkey = gbo->tgtkey;
+ PyObject *currkey = gbo->currkey;
555
+ Py_INCREF(tgtkey);
556
+ Py_INCREF(currkey);
557
558
rcmp = PyObject_RichCompareBool(tgtkey, currkey, Py_EQ);
559
- Py_DECREF(gbo -> tgtkey);
- Py_DECREF(gbo -> currkey);
560
+ Py_DECREF(tgtkey);
561
+ Py_DECREF(currkey);
562
563
if (rcmp == -1)
564
return NULL;
0 commit comments