Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 68304:c6a8e7debbe5
avoid casting with this nice macro
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sun, 06 Mar 2011 09:06:34 -0600 |
| parents | b39270c6b8d1 |
| children | b8d1cf9fde04 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Sun Mar 06 12:24:49 2011 +0100 +++ b/Objects/unicodeobject.c Sun Mar 06 09:06:34 2011 -0600 @@ -7358,8 +7358,7 @@ if (PyUnicode_Check(left) && PyUnicode_Check(right)) { PyObject *v; - if (((PyUnicodeObject *) left)->length != - ((PyUnicodeObject *) right)->length) { + if (PyUnicode_GET_SIZE(left) != PyUnicode_GET_SIZE(right)) { if (op == Py_EQ) { Py_INCREF(Py_False); return Py_False;
