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

[Support] Use StringRef::operator== instead of StringRef::equals (NFC) #91042

Merged
merged 1 commit into from
May 4, 2024

Conversation

kazutakahirata
Copy link
Contributor

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

  • StringRef::operator== outnumbers StringRef::equals by a factor of 25
    under llvm/ in terms of their usage.

  • The elimination of StringRef::equals brings StringRef closer to
    std::string_view, which has operator== but not equals.

  • S == "foo" is more readable than S.equals("foo"), especially for
    !Long.Expression.equals("str") vs Long.Expression != "str".

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator== outnumbers StringRef::equals by a factor of 25
  under llvm/ in terms of their usage.

- The elimination of StringRef::equals brings StringRef closer to
  std::string_view, which has operator== but not equals.

- S == "foo" is more readable than S.equals("foo"), especially for
  !Long.Expression.equals("str") vs Long.Expression != "str".
@kazutakahirata kazutakahirata merged commit 7ee6288 into llvm:main May 4, 2024
4 of 5 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_000 branch May 4, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants