Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use a ternary expression.
  • Loading branch information
ericsnowcurrently committed Feb 16, 2022
commit efe208f3cdd879251c72808b65f43247374a5d77
7 changes: 1 addition & 6 deletions Objects/boolobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
static PyObject *
bool_repr(PyObject *self)
{
if (self == Py_True) {
return &_Py_ID(True);
}
else {
return &_Py_ID(False);
}
return self == Py_True ? &_Py_ID(True) : &_Py_ID(False);
}

/* Function to return a bool from a C long */
Expand Down