We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b31e3f7 + b1b915c commit d06eeb4Copy full SHA for d06eeb4
1 file changed
Objects/stringlib/eq.h
@@ -20,15 +20,6 @@ unicode_eq(PyObject *aa, PyObject *bb)
20
return 1;
21
if (PyUnicode_KIND(a) != PyUnicode_KIND(b))
22
return 0;
23
- /* Just comparing the first byte is enough to see if a and b differ.
24
- * If they are 2 byte or 4 byte character most differences will happen in
25
- * the lower bytes anyways.
26
- */
27
- if (PyUnicode_1BYTE_DATA(a)[0] != PyUnicode_1BYTE_DATA(b)[0])
28
- return 0;
29
- if (PyUnicode_KIND(a) == PyUnicode_1BYTE_KIND &&
30
- PyUnicode_GET_LENGTH(a) == 1)
31
- return 1;
32
return memcmp(PyUnicode_1BYTE_DATA(a), PyUnicode_1BYTE_DATA(b),
33
PyUnicode_GET_LENGTH(a) * PyUnicode_KIND(a)) == 0;
34
}
0 commit comments