diff options
author | Guido van Rossum <guido@python.org> | 2007-09-18 18:39:50 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-09-18 18:39:50 (GMT) |
commit | e4a9e788d367b99162a0b584d23f4fd111bde1cf (patch) | |
tree | a29e04d8579ac3a1ff13262104407ae471151f97 /Objects/dictobject.c | |
parent | 89d8c60d0463b4714ceae6c05f7e8c20157fd589 (diff) | |
download | cpython-e4a9e788d367b99162a0b584d23f4fd111bde1cf.zip cpython-e4a9e788d367b99162a0b584d23f4fd111bde1cf.tar.gz cpython-e4a9e788d367b99162a0b584d23f4fd111bde1cf.tar.bz2 |
Thomas Wouters suggested an obvious improvement to unicode_eq():
use memcmp().
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 8d8a882..957090f 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -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; } |