diff options
Diffstat (limited to 'Objects/unicodeobject.c')
| -rw-r--r-- | Objects/unicodeobject.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 01e5355..17ae481 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -10526,7 +10526,7 @@ unicode_compare(PyObject *str1, PyObject *str2) #undef COMPARE } -static int +Py_LOCAL(int) unicode_compare_eq(PyObject *str1, PyObject *str2) { int kind; @@ -10630,10 +10630,8 @@ PyUnicode_RichCompare(PyObject *left, PyObject *right, int op) if (op == Py_EQ || op == Py_NE) { result = unicode_compare_eq(left, right); - if (op == Py_EQ) - v = TEST_COND(result); - else - v = TEST_COND(!result); + result ^= (op == Py_NE); + v = TEST_COND(result); } else { result = unicode_compare(left, right); |
