Skip to content

Commit c34fa2b

Browse files
authored
bpo-41117: Cleanup subtract_refs() (GH-27593)
subtract_refs() reuses the 'op' variable rather than calling the FROM_GC() macro twice. Issue reported by William Pickard.
1 parent cee67fa commit c34fa2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Modules/gcmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@ subtract_refs(PyGC_Head *containers)
479479
for (; gc != containers; gc = GC_NEXT(gc)) {
480480
PyObject *op = FROM_GC(gc);
481481
traverse = Py_TYPE(op)->tp_traverse;
482-
(void) traverse(FROM_GC(gc),
483-
(visitproc)visit_decref,
484-
op);
482+
(void) traverse(op,
483+
(visitproc)visit_decref,
484+
op);
485485
}
486486
}
487487

0 commit comments

Comments
 (0)