summaryrefslogtreecommitdiffstats
path: root/Objects/setobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-10-09 08:15:17 (GMT)
committerGitHub <noreply@github.com>2024-10-09 08:15:17 (GMT)
commite0c87c64b1cb4112ed5cfc1ae84ff8e48b1c0340 (patch)
tree6bb6ba38ecbc3cfe2a062f91326561ade463bfd2 /Objects/setobject.c
parent7f93dbf6fec152888727a0f25a3aa030d1fe27ca (diff)
downloadcpython-e0c87c64b1cb4112ed5cfc1ae84ff8e48b1c0340.zip
cpython-e0c87c64b1cb4112ed5cfc1ae84ff8e48b1c0340.tar.gz
cpython-e0c87c64b1cb4112ed5cfc1ae84ff8e48b1c0340.tar.bz2
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().
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 8bff4d9..9f40e08 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -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);