Replace PyObject_CallFunction() with fastcall
Replace
PyObject_CallFunction(func, "O", arg)
and
PyObject_CallFunction(func, "O", arg, NULL)
with
_PyObject_CallArg1(func, arg)
Replace
PyObject_CallFunction(func, NULL)
with
_PyObject_CallNoArg(func)
_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 1db83c9..0484b1c 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -1341,7 +1341,7 @@
PyObject *res;
Py_INCREF(firstiter);
- res = PyObject_CallFunction(firstiter, "O", o);
+ res = _PyObject_CallArg1(firstiter, o);
Py_DECREF(firstiter);
if (res == NULL) {
return 1;