diff options
author | Victor Stinner <vstinner@python.org> | 2021-08-04 16:09:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 16:09:14 (GMT) |
commit | c34fa2bb06ea44045af8493dfa414addb2b7ce66 (patch) | |
tree | 7d63239b917611821dccfa0040c4b792ba3ec2f7 /Modules/gcmodule.c | |
parent | cee67fa66129b5d1db5c8aa3884338f82f0da3de (diff) | |
download | cpython-c34fa2bb06ea44045af8493dfa414addb2b7ce66.zip cpython-c34fa2bb06ea44045af8493dfa414addb2b7ce66.tar.gz cpython-c34fa2bb06ea44045af8493dfa414addb2b7ce66.tar.bz2 |
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.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index e5e5aa3..2592c39 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); } } |