gh-124502: Remove _PyUnicode_EQ() function (#125114)

* Replace unicode_compare_eq() with unicode_eq().
* Use unicode_eq() in setobject.c.
* Replace _PyUnicode_EQ() with _PyUnicode_Equal().
* Remove unicode_compare_eq() and _PyUnicode_EQ().
This commit is contained in:
Victor Stinner 2024-10-09 10:15:17 +02:00 committed by GitHub
parent 7f93dbf6fe
commit e0c87c64b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 39 deletions

View file

@ -40,6 +40,8 @@
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_SSIZE_RELAXED()
#include "pycore_pyerrors.h" // _PyErr_SetKeyError()
#include "pycore_setobject.h" // _PySet_NextEntry() definition
#include "stringlib/eq.h" // unicode_eq()
#include <stddef.h> // offsetof()
#include "clinic/setobject.c.h"
@ -96,7 +98,7 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
return entry;
if (PyUnicode_CheckExact(startkey)
&& PyUnicode_CheckExact(key)
&& _PyUnicode_EQ(startkey, key))
&& unicode_eq(startkey, key))
return entry;
table = so->table;
Py_INCREF(startkey);
@ -157,7 +159,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash)
goto found_active;
if (PyUnicode_CheckExact(startkey)
&& PyUnicode_CheckExact(key)
&& _PyUnicode_EQ(startkey, key))
&& unicode_eq(startkey, key))
goto found_active;
table = so->table;
Py_INCREF(startkey);