Skip to content

Commit

Permalink
[ADT] Deprecate StringRef::equals (#92351)
Browse files Browse the repository at this point in the history
This patch deprecates StringRef::equals.  Note that I've migrated all
known users to operator==(StringRef, StringRef).
  • Loading branch information
kazutakahirata authored May 16, 2024
1 parent 8389177 commit de483ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/include/llvm/ADT/StringRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ namespace llvm {

/// equals - Check for string equality, this is more efficient than
/// compare() when the relative ordering of inequal strings isn't needed.
[[nodiscard]] bool equals(StringRef RHS) const {
[[nodiscard]] LLVM_DEPRECATED("Use == instead",
"==") bool equals(StringRef RHS) const {
return (Length == RHS.Length &&
compareMemory(Data, RHS.Data, RHS.Length) == 0);
}
Expand Down

0 comments on commit de483ad

Please sign in to comment.