Issue #27128: slot_nb_bool() now calls _PyObject_FastCall() to avoid a
temporary empty tuple to call the slot function.
static int
slot_nb_bool(PyObject *self)
{
- PyObject *func, *args, *value;
+ PyObject *func, *value;
int result;
int using_len = 0;
_Py_IDENTIFIER(__bool__);
using_len = 1;
}
- args = PyTuple_New(0);
- if (args == NULL) {
- goto error;
- }
-
- value = PyObject_Call(func, args, NULL);
- Py_DECREF(args);
+ value = _PyObject_FastCall(func, NULL, 0, NULL);
if (value == NULL) {
goto error;
}