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.
This commit is contained in:
Victor Stinner
2021-08-04 18:09:14 +02:00
committed by GitHub
parent cee67fa661
commit c34fa2bb06

View File

@@ -479,9 +479,9 @@ subtract_refs(PyGC_Head *containers)
for (; gc != containers; gc = GC_NEXT(gc)) {
PyObject *op = FROM_GC(gc);
traverse = Py_TYPE(op)->tp_traverse;
(void) traverse(FROM_GC(gc),
(visitproc)visit_decref,
op);
(void) traverse(op,
(visitproc)visit_decref,
op);
}
}