Skip to content

Commit be7ead6

Browse files
authored
bpo-39737: Remove code repitition in list_richcompare (GH-18638)
I may speed up list comparison on some platforms.
1 parent 57c7a0b commit be7ead6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Objects/listobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,8 +2643,7 @@ list_richcompare(PyObject *v, PyObject *w, int op)
26432643

26442644
Py_INCREF(vitem);
26452645
Py_INCREF(witem);
2646-
int k = PyObject_RichCompareBool(vl->ob_item[i],
2647-
wl->ob_item[i], Py_EQ);
2646+
int k = PyObject_RichCompareBool(vitem, witem, Py_EQ);
26482647
Py_DECREF(vitem);
26492648
Py_DECREF(witem);
26502649
if (k < 0)

0 commit comments

Comments
 (0)