Skip to content

Commit c239604

Browse files
author
git apple-llvm automerger
committed
Merge commit '774b7eb7bacc' from llvm.org/main into next
2 parents 50fd845 + 774b7eb commit c239604

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/include/llvm/ADT/StringRef.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,11 @@ namespace llvm {
871871
/// @{
872872

873873
inline bool operator==(StringRef LHS, StringRef RHS) {
874-
return LHS.equals(RHS);
874+
if (LHS.size() != RHS.size())
875+
return false;
876+
if (LHS.empty())
877+
return true;
878+
return ::memcmp(LHS.data(), RHS.data(), LHS.size()) == 0;
875879
}
876880

877881
inline bool operator!=(StringRef LHS, StringRef RHS) { return !(LHS == RHS); }

0 commit comments

Comments
 (0)