Skip to content

gh-124502: Remove _PyUnicode_EQ() function#125114

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

gh-124502: Remove _PyUnicode_EQ() function#125114
vstinner merged 2 commits intopython:mainfrom
vstinner:remove_unicode_eq

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 8, 2024

  • 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
Copy link
Member Author

vstinner commented Oct 8, 2024

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
Copy link
Member Author

vstinner commented Oct 8, 2024

@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
Copy link
Member Author

vstinner commented Oct 9, 2024

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