mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
7f93dbf6fe
commit
e0c87c64b1
4 changed files with 10 additions and 39 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue