diff options
| author | Guido van Rossum <guido@python.org> | 2007-09-18 18:39:50 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2007-09-18 18:39:50 +0000 |
| commit | e4a9e788d367b99162a0b584d23f4fd111bde1cf (patch) | |
| tree | a29e04d8579ac3a1ff13262104407ae471151f97 /Objects | |
| parent | 89d8c60d0463b4714ceae6c05f7e8c20157fd589 (diff) | |
| download | cpython-git-e4a9e788d367b99162a0b584d23f4fd111bde1cf.tar.gz | |
Thomas Wouters suggested an obvious improvement to unicode_eq():
use memcmp().
Diffstat (limited to 'Objects')
| -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 8d8a882611..957090f191 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; } |
