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:
Victor Stinner 2016-08-19 16:42:42 +02:00
parent 9be7e7b52f
commit 3f745bf1d9
1 changed files with 4 additions and 0 deletions

View File

@ -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;