]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39737: Remove code repitition in list_richcompare (GH-18638)
authorsweeneyde <36520290+sweeneyde@users.noreply.github.com>
Wed, 26 Feb 2020 07:00:35 +0000 (02:00 -0500)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2020 07:00:35 +0000 (09:00 +0200)
I may speed up list comparison on some platforms.

Objects/listobject.c

index 3c39c6444bfd69adb04489765bd8bb8837f416c2..3ac03b71d03ac705a3e369ba6f0e3276c72f34d0 100644 (file)
@@ -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)