From c34fa2bb06ea44045af8493dfa414addb2b7ce66 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 4 Aug 2021 18:09:14 +0200 Subject: 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. --- Modules/gcmodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Modules/gcmodule.c') diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index e5e5aa3287..2592c397cf 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); } } -- cgit v1.2.1