mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
This commit is contained in:
parent
3b0cae9cc0
commit
684fd0c8ec
8 changed files with 17 additions and 20 deletions
|
@ -4053,7 +4053,7 @@ build_class(PyObject *methods, PyObject *bases, PyObject *name)
|
|||
metaclass = (PyObject *) &PyClass_Type;
|
||||
Py_INCREF(metaclass);
|
||||
}
|
||||
result = PyObject_CallFunction(metaclass, "OOO", name, bases, methods);
|
||||
result = PyObject_CallFunctionObjArgs(metaclass, name, bases, methods, NULL);
|
||||
Py_DECREF(metaclass);
|
||||
if (result == NULL && PyErr_ExceptionMatches(PyExc_TypeError)) {
|
||||
/* A type error here likely means that the user passed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue