diff options
author | Georg Brandl <georg@python.org> | 2006-05-25 19:15:31 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-25 19:15:31 (GMT) |
commit | 684fd0c8ec0bad54d3ff39ae15873f80e119478b (patch) | |
tree | 56596aed7bfd401ebe049e566201f75f88150b27 /Modules | |
parent | 3b0cae9cc06374eb7a7159f1328ec700208d6109 (diff) | |
download | cpython-684fd0c8ec0bad54d3ff39ae15873f80e119478b.zip cpython-684fd0c8ec0bad54d3ff39ae15873f80e119478b.tar.gz cpython-684fd0c8ec0bad54d3ff39ae15873f80e119478b.tar.bz2 |
Replace PyObject_CallFunction calls with only object args
with PyObject_CallFunctionObjArgs, which is 30% faster.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/cPickle.c | 4 | ||||
-rw-r--r-- | Modules/gcmodule.c | 2 | ||||
-rw-r--r-- | Modules/parsermodule.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 9948ba7..4c630bb 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -3073,8 +3073,8 @@ find_class(PyObject *py_module_name, PyObject *py_global_name, PyObject *fc) "pickles are not supported."); return NULL; } - return PyObject_CallFunction(fc, "OO", py_module_name, - py_global_name); + return PyObject_CallFunctionObjArgs(fc, py_module_name, + py_global_name, NULL); } module = PySys_GetObject("modules"); diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 6ff2c9a..872727d 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -603,7 +603,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) assert(callback != NULL); /* copy-paste of weakrefobject.c's handle_callback() */ - temp = PyObject_CallFunction(callback, "O", wr); + temp = PyObject_CallFunctionObjArgs(callback, wr, NULL); if (temp == NULL) PyErr_WriteUnraisable(callback); else diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index c9edae6..e33197e 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -3267,8 +3267,8 @@ initparser(void) && (pickler != NULL)) { PyObject *res; - res = PyObject_CallFunction(func, "OOO", &PyST_Type, pickler, - pickle_constructor); + res = PyObject_CallFunctionObjArgs(func, &PyST_Type, pickler, + pickle_constructor, NULL); Py_XDECREF(res); } Py_XDECREF(func); |