Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-124502: Remove _PyUnicode_EQ() function #125114

Merged
merged 2 commits into from
Oct 9, 2024

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

cc @serhiy-storchaka

@vstinner vstinner merged commit e0c87c6 into python:main Oct 9, 2024
37 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants