diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-01-05 19:27:54 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-01-05 19:27:54 (GMT) |
commit | 576f132b986b5ee60e4b84d34a519a5edcd8c03e (patch) | |
tree | f048292ddc0b5c3d6a5afc50dc2cd4b28372c655 /Modules/_lsprof.c | |
parent | dcf76c9d0ab11f77eaa856ff0583c5c636ddb47d (diff) | |
download | cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.zip cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.tar.gz cpython-576f132b986b5ee60e4b84d34a519a5edcd8c03e.tar.bz2 |
Issue #20440: Cleaning up the code by using Py_SETREF.
Diffstat (limited to 'Modules/_lsprof.c')
-rw-r--r-- | Modules/_lsprof.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 66e534f..d3ed758 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -762,7 +762,6 @@ profiler_dealloc(ProfilerObject *op) static int profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw) { - PyObject *o; PyObject *timer = NULL; double timeunit = 0.0; int subcalls = 1; @@ -777,11 +776,9 @@ profiler_init(ProfilerObject *pObj, PyObject *args, PyObject *kw) if (setSubcalls(pObj, subcalls) < 0 || setBuiltins(pObj, builtins) < 0) return -1; - o = pObj->externalTimer; - pObj->externalTimer = timer; - Py_XINCREF(timer); - Py_XDECREF(o); pObj->externalTimerUnit = timeunit; + Py_XINCREF(timer); + Py_SETREF(pObj->externalTimer, timer); return 0; } |