@@ -261,7 +261,6 @@ _PyUnicode_InternedSize_Immortal(void)
261261}
262262
263263static Py_hash_t unicode_hash (PyObject * );
264- static int unicode_compare_eq (PyObject * , PyObject * );
265264
266265static Py_uhash_t
267266hashtable_unicode_hash (const void * key )
@@ -275,7 +274,7 @@ hashtable_unicode_compare(const void *key1, const void *key2)
275274 PyObject * obj1 = (PyObject * )key1 ;
276275 PyObject * obj2 = (PyObject * )key2 ;
277276 if (obj1 != NULL && obj2 != NULL ) {
278- return unicode_compare_eq (obj1 , obj2 );
277+ return unicode_eq (obj1 , obj2 );
279278 }
280279 else {
281280 return obj1 == obj2 ;
@@ -10968,26 +10967,6 @@ unicode_compare(PyObject *str1, PyObject *str2)
1096810967#undef COMPARE
1096910968}
1097010969
10971- static int
10972- unicode_compare_eq (PyObject * str1 , PyObject * str2 )
10973- {
10974- int kind ;
10975- const void * data1 , * data2 ;
10976- Py_ssize_t len ;
10977- int cmp ;
10978-
10979- len = PyUnicode_GET_LENGTH (str1 );
10980- if (PyUnicode_GET_LENGTH (str2 ) != len )
10981- return 0 ;
10982- kind = PyUnicode_KIND (str1 );
10983- if (PyUnicode_KIND (str2 ) != kind )
10984- return 0 ;
10985- data1 = PyUnicode_DATA (str1 );
10986- data2 = PyUnicode_DATA (str2 );
10987-
10988- cmp = memcmp (data1 , data2 , len * kind );
10989- return (cmp == 0 );
10990- }
1099110970
1099210971int
1099310972_PyUnicode_Equal (PyObject * str1 , PyObject * str2 )
@@ -10997,7 +10976,7 @@ _PyUnicode_Equal(PyObject *str1, PyObject *str2)
1099710976 if (str1 == str2 ) {
1099810977 return 1 ;
1099910978 }
11000- return unicode_compare_eq (str1 , str2 );
10979+ return unicode_eq (str1 , str2 );
1100110980}
1100210981
1100310982
@@ -11213,7 +11192,7 @@ _PyUnicode_EqualToASCIIId(PyObject *left, _Py_Identifier *right)
1121311192 return 0 ;
1121411193 }
1121511194
11216- return unicode_compare_eq (left , right_uni );
11195+ return unicode_eq (left , right_uni );
1121711196}
1121811197
1121911198PyObject *
@@ -11241,7 +11220,7 @@ PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
1124111220 }
1124211221 }
1124311222 else if (op == Py_EQ || op == Py_NE ) {
11244- result = unicode_compare_eq (left , right );
11223+ result = unicode_eq (left , right );
1124511224 result ^= (op == Py_NE );
1124611225 return PyBool_FromLong (result );
1124711226 }
@@ -11251,12 +11230,6 @@ PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
1125111230 }
1125211231}
1125311232
11254- int
11255- _PyUnicode_EQ (PyObject * aa , PyObject * bb )
11256- {
11257- return unicode_eq (aa , bb );
11258- }
11259-
1126011233int
1126111234PyUnicode_Contains (PyObject * str , PyObject * substr )
1126211235{
0 commit comments