summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-08-16 16:14:00 (GMT)
committerGuido van Rossum <guido@python.org>2002-08-16 16:14:00 (GMT)
commitc13f724af0a09d515efae57b902a1270b6aba4ac (patch)
tree7c90699ab5c6a8cc24a4f542763c6e2f0ef04f0c
parent49931887d7e135190fbcf0119e03419a7101ff7c (diff)
downloadcpython-c13f724af0a09d515efae57b902a1270b6aba4ac.zip
cpython-c13f724af0a09d515efae57b902a1270b6aba4ac.tar.gz
cpython-c13f724af0a09d515efae57b902a1270b6aba4ac.tar.bz2
Streamline the fast track for CFunction calls a bit more: there was
nothing special done if keyword arguments were present, so test for that earlier and fall through to the normal case if there are any. This ought to slow down CFunction calls with keyword args, but I don't care; it's a tiny (1%) improvement for pystone.
-rw-r--r--Python/ceval.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 6985846..954d078 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1975,12 +1975,9 @@ eval_frame(PyFrameObject *f)
these are presumed to be the most frequent
callable object.
*/
- if (PyCFunction_Check(func)) {
+ if (PyCFunction_Check(func) && nk == 0) {
int flags = PyCFunction_GET_FLAGS(func);
- if (nk != 0 || (flags & METH_KEYWORDS))
- x = do_call(func, &stack_pointer,
- na, nk);
- else if (flags == METH_VARARGS) {
+ if (flags & (METH_VARARGS | METH_KEYWORDS)) {
PyObject *callargs;
callargs = load_args(&stack_pointer, na);
x = PyCFunction_Call(func, callargs, NULL);