From: Victor Stinner Date: Wed, 4 Aug 2021 16:09:14 +0000 (+0200) Subject: bpo-41117: Cleanup subtract_refs() (GH-27593) X-Git-Tag: v3.11.0a1~477 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c34fa2bb06ea44045af8493dfa414addb2b7ce66;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index e5e5aa3287b0..2592c397cf2f 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -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); } }