Kaydet (Commit) db865611 authored tarafından Tim Peters's avatar Tim Peters

has_finalizer(): simplified "if (complicated_bool) 1 else 0" to

"complicated_bool".
üst 49cc01e5
...@@ -236,14 +236,9 @@ has_finalizer(PyObject *op) ...@@ -236,14 +236,9 @@ has_finalizer(PyObject *op)
if (delstr == NULL) if (delstr == NULL)
Py_FatalError("PyGC: can't initialize __del__ string"); Py_FatalError("PyGC: can't initialize __del__ string");
} }
if ((PyInstance_Check(op) || return (PyInstance_Check(op) ||
PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) && PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE))
PyObject_HasAttr(op, delstr)) { && PyObject_HasAttr(op, delstr);
return 1;
}
else {
return 0;
}
} }
/* Move all objects with finalizers (instances with __del__) */ /* Move all objects with finalizers (instances with __del__) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment