[llvm] [ADT] Remove StringRef::equals (PR #98735)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 13 03:13:32 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

StringRef::equals has been deprecated since:

  commit de483ad513895c0adf7f21c7001c30f031998ea3
  Author: Kazu Hirata <kazu@<!-- -->google.com>
  Date:   Thu May 16 00:38:37 2024 -0700


---
Full diff: https://github.com/llvm/llvm-project/pull/98735.diff


1 Files Affected:

- (modified) llvm/include/llvm/ADT/StringRef.h (-8) 


``````````diff
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
index 2120c04530b23..049f22b03e46e 100644
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -159,14 +159,6 @@ namespace llvm {
       return StringRef(S, Length);
     }
 
-    /// equals - Check for string equality, this is more efficient than
-    /// compare() when the relative ordering of inequal strings isn't needed.
-    [[nodiscard]] LLVM_DEPRECATED("Use == instead",
-                                  "==") bool equals(StringRef RHS) const {
-      return (Length == RHS.Length &&
-              compareMemory(Data, RHS.Data, RHS.Length) == 0);
-    }
-
     /// Check for string equality, ignoring case.
     [[nodiscard]] bool equals_insensitive(StringRef RHS) const {
       return Length == RHS.Length && compare_insensitive(RHS) == 0;

``````````

</details>


https://github.com/llvm/llvm-project/pull/98735


More information about the llvm-commits mailing list