mirror of
https://github.com/python/cpython.git
synced 2024-12-02 22:35:26 +08:00
bpo-38588: Optimize list comparison. (GH-17766)
Mitigate performance regression of the list comparison caused by 2d5bf56
.
This commit is contained in:
parent
2d5bf568ea
commit
dfef986f12
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user