Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd9e44d commit f0c7b2aCopy full SHA for f0c7b2a
1 file changed
Objects/unicodeobject.c
@@ -10428,10 +10428,6 @@ unicode_compare(PyObject *str1, PyObject *str2)
10428
void *data1, *data2;
10429
Py_ssize_t len1, len2, len;
10430
10431
- /* a string is equal to itself */
10432
- if (str1 == str2)
10433
- return 0;
10434
-
10435
kind1 = PyUnicode_KIND(str1);
10436
kind2 = PyUnicode_KIND(str2);
10437
data1 = PyUnicode_DATA(str1);
@@ -10555,6 +10551,11 @@ PyUnicode_Compare(PyObject *left, PyObject *right)
10555
10551
if (PyUnicode_READY(left) == -1 ||
10556
10552
PyUnicode_READY(right) == -1)
10557
10553
return -1;
10554
+
+ /* a string is equal to itself */
+ if (left == right)
+ return 0;
10558
10559
return unicode_compare(left, right);
10560
}
10561
PyErr_Format(PyExc_TypeError,
0 commit comments