mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Thomas Wouters suggested an obvious improvement to unicode_eq():
use memcmp().
This commit is contained in:
parent
89d8c60d04
commit
e4a9e788d3
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue