diff options
| author | orivej <[email protected]> | 2022-02-10 16:44:49 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:49 +0300 |
| commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
| tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/python3/src/Objects/stringlib/eq.h | |
| parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Objects/stringlib/eq.h')
| -rw-r--r-- | contrib/tools/python3/src/Objects/stringlib/eq.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/tools/python3/src/Objects/stringlib/eq.h b/contrib/tools/python3/src/Objects/stringlib/eq.h index 9c1058b86cb..4efd5181575 100644 --- a/contrib/tools/python3/src/Objects/stringlib/eq.h +++ b/contrib/tools/python3/src/Objects/stringlib/eq.h @@ -1,25 +1,25 @@ -/* Fast unicode equal function optimized for dictobject.c and setobject.c */ - -/* Return 1 if two unicode objects are equal, 0 if not. - * unicode_eq() is called when the hash of two unicode objects is equal. - */ -Py_LOCAL_INLINE(int) -unicode_eq(PyObject *aa, PyObject *bb) -{ +/* Fast unicode equal function optimized for dictobject.c and setobject.c */ + +/* Return 1 if two unicode objects are equal, 0 if not. + * unicode_eq() is called when the hash of two unicode objects is equal. + */ +Py_LOCAL_INLINE(int) +unicode_eq(PyObject *aa, PyObject *bb) +{ assert(PyUnicode_Check(aa)); assert(PyUnicode_Check(bb)); assert(PyUnicode_IS_READY(aa)); assert(PyUnicode_IS_READY(bb)); - PyUnicodeObject *a = (PyUnicodeObject *)aa; - PyUnicodeObject *b = (PyUnicodeObject *)bb; - - if (PyUnicode_GET_LENGTH(a) != PyUnicode_GET_LENGTH(b)) - return 0; - if (PyUnicode_GET_LENGTH(a) == 0) - return 1; - if (PyUnicode_KIND(a) != PyUnicode_KIND(b)) - return 0; - return memcmp(PyUnicode_1BYTE_DATA(a), PyUnicode_1BYTE_DATA(b), - PyUnicode_GET_LENGTH(a) * PyUnicode_KIND(a)) == 0; -} + PyUnicodeObject *a = (PyUnicodeObject *)aa; + PyUnicodeObject *b = (PyUnicodeObject *)bb; + + if (PyUnicode_GET_LENGTH(a) != PyUnicode_GET_LENGTH(b)) + return 0; + if (PyUnicode_GET_LENGTH(a) == 0) + return 1; + if (PyUnicode_KIND(a) != PyUnicode_KIND(b)) + return 0; + return memcmp(PyUnicode_1BYTE_DATA(a), PyUnicode_1BYTE_DATA(b), + PyUnicode_GET_LENGTH(a) * PyUnicode_KIND(a)) == 0; +} |
