diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-05-16 21:36:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 21:36:02 (GMT) |
commit | b4a974792355cb0f525211b2962679e68949f02e (patch) | |
tree | 415cc6db406a9e39d544d0e6a4acc45a9b3204c2 /Objects/boolobject.c | |
parent | 3a4c44bb1e92802db64deec59cf8a68ad3973219 (diff) | |
download | cpython-b4a974792355cb0f525211b2962679e68949f02e.zip cpython-b4a974792355cb0f525211b2962679e68949f02e.tar.gz cpython-b4a974792355cb0f525211b2962679e68949f02e.tar.bz2 |
GH-103906: Remove immortal refcounting in the interpreter (GH-103909)
Diffstat (limited to 'Objects/boolobject.c')
-rw-r--r-- | Objects/boolobject.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Objects/boolobject.c b/Objects/boolobject.c index 0300f7b..f43e26f 100644 --- a/Objects/boolobject.c +++ b/Objects/boolobject.c @@ -20,13 +20,7 @@ bool_repr(PyObject *self) PyObject *PyBool_FromLong(long ok) { - PyObject *result; - - if (ok) - result = Py_True; - else - result = Py_False; - return Py_NewRef(result); + return ok ? Py_True : Py_False; } /* We define bool_new to always return either Py_True or Py_False */ |