Skip to content

Commit 336c367

Browse files
Fix duplicate variable declarations in groupby_next
1 parent 1ea51c0 commit 336c367

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Modules/itertoolsmodule.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -545,20 +545,16 @@ groupby_next(PyObject *op)
545545
break;
546546
else {
547547
int rcmp;
548-
PyObject *tgtkey = gbo->tgtkey;
549-
PyObject *currkey = gbo->currkey;
550-
548+
551549
/* Hold strong references during comparison to prevent re-entrant __eq__
552550
from advancing the iterator and invalidating borrowed references. */
553-
PyObject *tgtkey = gbo->tgtkey;
554-
PyObject *currkey = gbo->currkey;
555-
Py_INCREF(tgtkey);
556-
Py_INCREF(currkey);
551+
Py_INCREF(gbo -> tgtkey);
552+
Py_INCREF(gbo -> currkey);
557553

558554
rcmp = PyObject_RichCompareBool(tgtkey, currkey, Py_EQ);
559555

560-
Py_DECREF(tgtkey);
561-
Py_DECREF(currkey);
556+
Py_DECREF(gbo -> tgtkey);
557+
Py_DECREF(gbo -> currkey);
562558

563559
if (rcmp == -1)
564560
return NULL;

0 commit comments

Comments
 (0)