/* Fast unicode equal function optimized for dictobject.c and setobject.c */12/* Return 1 if two unicode objects are equal, 0 if not.3* unicode_eq() is called when the hash of two unicode objects is equal.4*/5Py_LOCAL_INLINE(int)6unicode_eq(PyObject *a, PyObject *b)7{8if (PyUnicode_GET_LENGTH(a) != PyUnicode_GET_LENGTH(b))9return 0;10if (PyUnicode_GET_LENGTH(a) == 0)11return 1;12if (PyUnicode_KIND(a) != PyUnicode_KIND(b))13return 0;14return memcmp(PyUnicode_1BYTE_DATA(a), PyUnicode_1BYTE_DATA(b),15PyUnicode_GET_LENGTH(a) * PyUnicode_KIND(a)) == 0;16}171819