Skip to content

Commit de483ad

Browse files
[ADT] Deprecate StringRef::equals (#92351)
This patch deprecates StringRef::equals. Note that I've migrated all known users to operator==(StringRef, StringRef).
1 parent 8389177 commit de483ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/ADT/StringRef.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ namespace llvm {
161161

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

0 commit comments

Comments
 (0)