mirror of
https://github.com/python/cpython.git
synced 2025-07-31 15:14:22 +00:00
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
1 changed files with 4 additions and 0 deletions
|
@ -4592,6 +4592,10 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (arg == NULL) {
|
if (arg == NULL) {
|
||||||
|
if (kw == NULL) {
|
||||||
|
return _PyObject_FastCall(func, NULL, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
arg = PyTuple_New(0);
|
arg = PyTuple_New(0);
|
||||||
if (arg == NULL)
|
if (arg == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue