]> granicus.if.org Git - python/commitdiff
docompare(): Another reasonable optimization from Jonathan Hogg for the
authorTim Peters <tim.peters@gmail.com>
Mon, 15 Jul 2002 05:16:13 +0000 (05:16 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 15 Jul 2002 05:16:13 +0000 (05:16 +0000)
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).

Misc/ACKS
Objects/listobject.c

index 4ecc56f77d26eaa975f06a2aa90338dc1cbcb7fe..5a4501e3f4402f72756378a71bacfda296a36c88 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -213,6 +213,7 @@ Joerg-Cyril Hoehle
 Gregor Hoffleit
 Chris Hoffman
 Albert Hofkamp
+Jonathan Hogg
 Gerrit Holl
 Philip Homburg
 Naofumi Honda
index dd2d5806dd3bb701aa3291b7fb3ae6d013e731e1..4825e9b0b905b89af33e2d55b00a7411c6bc1f4d 100644 (file)
@@ -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;