Commit 9425a372 authored by Guido van Rossum's avatar Guido van Rossum

Thomas Wouters suggested an obvious improvement to unicode_eq():

use memcmp().
parent 6bb927ae
......@@ -340,7 +340,7 @@ unicode_eq(PyObject *aa, PyObject *bb)
return 0;
if (a->length == 1)
return 1;
return PyUnicode_Compare(aa, bb) == 0;
return memcmp(a->str, b->str, a->length * sizeof(Py_UNICODE)) == 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