Commit e38a2cdc authored by Stefan Behnel's avatar Stefan Behnel

streamline non-C-function fallback code for the 1-arg call case to avoid...

streamline non-C-function fallback code for the 1-arg call case to avoid overhead beyond the type checks
parent ebafd549
...@@ -1174,9 +1174,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec ...@@ -1174,9 +1174,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
|| PyObject_TypeCheck(func, __pyx_CyFunctionType) || PyObject_TypeCheck(func, __pyx_CyFunctionType)
#endif #endif
) || !(PyCFunction_GET_FLAGS(func) & METH_O)) { ) || !(PyCFunction_GET_FLAGS(func) & METH_O)) {
PyObject* args = PyTuple_Pack(1, arg); PyObject* args = PyTuple_New(1);
if (unlikely(!args)) return NULL; if (unlikely(!args)) return NULL;
PyTuple_SET_ITEM(args, 0, arg);
result = __Pyx_PyObject_Call(func, args, NULL); result = __Pyx_PyObject_Call(func, args, NULL);
PyTuple_SET_ITEM(args, 0, NULL);
Py_DECREF(args); Py_DECREF(args);
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment