Skip to content

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

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:remove_unicode_eq
Oct 9, 2024
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:remove_unicode_eq

Conversation

@vstinner

@vstinner vstinner commented Oct 8, 2024 •

Copy link
Copy Markdown
Member
  • Replace unicode_compare_eq() with unicode_eq().
  • Replace _PyUnicode_EQ() with _PyUnicode_Equal().
  • Remove unicode_compare_eq() and _PyUnicode_EQ().
* Replace unicode_compare_eq() with unicode_eq().
* Replace _PyUnicode_EQ() with _PyUnicode_Equal().
* Remove unicode_compare_eq() and _PyUnicode_EQ().
@vstinner

vstinner commented Oct 8, 2024

Copy link
Copy Markdown
Member Author

For setobject.c, I decided to reuse unicode_eq() of Objects/stringlib/eq.h instead of _PyUnicode_Equal(), because _PyUnicode_Equal() repeats str1 == str2 test which is already done by setobject.c.

dictobject.c also uses unicode_eq() of Objects/stringlib/eq.h for a similar reason (and for best performance, I suppose).

@vstinner

vstinner commented Oct 8, 2024

Copy link
Copy Markdown
Member Author
@vstinner
vstinner merged commit e0c87c6 into python:main Oct 9, 2024
@vstinner
vstinner deleted the remove_unicode_eq branch October 9, 2024 08:15
@vstinner

vstinner commented Oct 9, 2024

Copy link
Copy Markdown
Member Author

Merged, thanks for the review @serhiy-storchaka.

efimov-mikhail pushed a commit to efimov-mikhail/cpython that referenced this pull request Oct 9, 2024
* 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().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants