From: sweeneyde <36520290+sweeneyde@users.noreply.github.com> Date: Wed, 26 Feb 2020 07:00:35 +0000 (-0500) Subject: bpo-39737: Remove code repitition in list_richcompare (GH-18638) X-Git-Tag: v3.9.0a5~236 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be7ead62db9a1db3e2cd997b0beffd4480e51f5c;p=thirdparty%2FPython%2Fcpython.git bpo-39737: Remove code repitition in list_richcompare (GH-18638) I may speed up list comparison on some platforms. --- diff --git a/Objects/listobject.c b/Objects/listobject.c index 3c39c6444bfd..3ac03b71d03a 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2643,8 +2643,7 @@ list_richcompare(PyObject *v, PyObject *w, int op) Py_INCREF(vitem); Py_INCREF(witem); - int k = PyObject_RichCompareBool(vl->ob_item[i], - wl->ob_item[i], Py_EQ); + int k = PyObject_RichCompareBool(vitem, witem, Py_EQ); Py_DECREF(vitem); Py_DECREF(witem); if (k < 0)