Skip to content

Commit

Permalink
bpo-38588: Optimize list comparison. (GH-17766)
Browse files Browse the repository at this point in the history
Mitigate performance regression of the list comparison caused by 2d5bf56.
  • Loading branch information
methane committed Dec 31, 2019
1 parent 2d5bf56 commit dfef986
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Objects/listobject.c
Expand Up @@ -2664,6 +2664,9 @@ list_richcompare(PyObject *v, PyObject *w, int op)
for (i = 0; i < Py_SIZE(vl) && i < Py_SIZE(wl); i++) {
PyObject *vitem = vl->ob_item[i];
PyObject *witem = wl->ob_item[i];
if (vitem == witem) {
continue;
}

Py_INCREF(vitem);
Py_INCREF(witem);
Expand Down

0 comments on commit dfef986

Please sign in to comment.