diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-07-15 05:16:13 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-07-15 05:16:13 (GMT) |
commit | 58cf361e35ba64f51b30e75737720bc73c7f6f2e (patch) | |
tree | 9874500af2262f6f36f40ce4d2e645c68395cb69 /Objects/listobject.c | |
parent | 155adbdcbb18a8eb66826034bff391f3cb0059a6 (diff) | |
download | cpython-58cf361e35ba64f51b30e75737720bc73c7f6f2e.zip cpython-58cf361e35ba64f51b30e75737720bc73c7f6f2e.tar.gz cpython-58cf361e35ba64f51b30e75737720bc73c7f6f2e.tar.bz2 |
docompare(): Another reasonable optimization from Jonathan Hogg for the
explicit comparison function case: use PyObject_Call instead of
PyEval_CallObject. Same thing in context, but gives a 2.4% overall
speedup when sorting a list of ints via list.sort(__builtin__.cmp).
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r-- | Objects/listobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index dd2d580..4825e9b 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -780,7 +780,7 @@ docompare(PyObject *x, PyObject *y, PyObject *compare) Py_INCREF(y); PyTuple_SET_ITEM(args, 0, x); PyTuple_SET_ITEM(args, 1, y); - res = PyEval_CallObject(compare, args); + res = PyObject_Call(compare, args, NULL); Py_DECREF(args); if (res == NULL) return CMPERROR; |