Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-38588: Optimize list comparison.
Mitigate performance regression of the list comparison caused by
2d5bf56.
  • Loading branch information
methane committed Dec 31, 2019
commit 84722afe798c099c1ab3ed4c8a69bf5aacdd1279
3 changes: 3 additions & 0 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
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