diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-11-01 19:35:45 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-11-01 19:35:45 (GMT) |
commit | db8656118a1ea669985003a8f47b3d59e5b01618 (patch) | |
tree | 1cc16714afb4943b34370313cb4c30de1a31296f /Modules/gcmodule.c | |
parent | 49cc01e552e13ab51054c44df3e54655dbb1b5df (diff) | |
download | cpython-db8656118a1ea669985003a8f47b3d59e5b01618.zip cpython-db8656118a1ea669985003a8f47b3d59e5b01618.tar.gz cpython-db8656118a1ea669985003a8f47b3d59e5b01618.tar.bz2 |
has_finalizer(): simplified "if (complicated_bool) 1 else 0" to
"complicated_bool".
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 0738eb6..08b57ac 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -236,14 +236,9 @@ has_finalizer(PyObject *op) if (delstr == NULL) Py_FatalError("PyGC: can't initialize __del__ string"); } - if ((PyInstance_Check(op) || - PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) && - PyObject_HasAttr(op, delstr)) { - return 1; - } - else { - return 0; - } + return (PyInstance_Check(op) || + PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) + && PyObject_HasAttr(op, delstr); } /* Move all objects with finalizers (instances with __del__) */ |