Commit 0e413bd2 authored by Raymond Hettinger's avatar Raymond Hettinger

Issue 18719: Remove a false optimization

Remove an unused early-out test from the critical path for
dict and set lookups.

When the strings already have matching lengths and hashes,
there is no additional information gained by checking the first
characters (the probability of a mismatch is already known to
be less than 1 in 2**64).
parent b638a38d
......@@ -1255,7 +1255,6 @@ _PyString_Eq(PyObject *o1, PyObject *o2)
PyStringObject *a = (PyStringObject*) o1;
PyStringObject *b = (PyStringObject*) o2;
return Py_SIZE(a) == Py_SIZE(b)
&& *a->ob_sval == *b->ob_sval
&& memcmp(a->ob_sval, b->ob_sval, Py_SIZE(a)) == 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment