PyEval_CallObjectWithKeywords() uses fast call
Issue #27128: Modify PyEval_CallObjectWithKeywords() to use _PyObject_FastCall() when args==NULL and kw==NULL. It avoids the creation of a temporary empty tuple for positional arguments.
This commit is contained in:
parent
9be7e7b52f
commit
3f745bf1d9
|
@ -4592,6 +4592,10 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
|
|||
#endif
|
||||
|
||||
if (arg == NULL) {
|
||||
if (kw == NULL) {
|
||||
return _PyObject_FastCall(func, NULL, 0, 0);
|
||||
}
|
||||
|
||||
arg = PyTuple_New(0);
|
||||
if (arg == NULL)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue