From: Benjamin Peterson Date: Sun, 6 Mar 2011 15:06:34 +0000 (-0600) Subject: avoid casting with this nice macro X-Git-Tag: v3.3.0a1~2980 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fd4bd3796a220932c6148de2d08589a7f1b93d6;p=python avoid casting with this nice macro --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1d0e97b8ce..db9f7060ed 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -7358,8 +7358,7 @@ PyUnicode_RichCompare(PyObject *left, PyObject *right, int op) 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;