aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Archive.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-08 10:33:53 -0700
committerGitHub <noreply@github.com>2024-05-08 10:33:53 -0700
commitbb6df0804ba0a0b0581aec4156138f5144dbcee2 (patch)
tree9f1bf9618fd27b9941c88b59f5790dc9049eda7f /llvm/lib/Object/Archive.cpp
parent46435ac19e09039fb146fa6c12da0e640a66d435 (diff)
downloadllvm-bb6df0804ba0a0b0581aec4156138f5144dbcee2.zip
llvm-bb6df0804ba0a0b0581aec4156138f5144dbcee2.tar.gz
llvm-bb6df0804ba0a0b0581aec4156138f5144dbcee2.tar.bz2
[llvm] Use StringRef::operator== instead of StringRef::equals (NFC) (#91441)
I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator==/!= outnumber StringRef::equals by a factor of 70 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".
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r--llvm/lib/Object/Archive.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
index 6139d99..e798bbd 100644
--- a/llvm/lib/Object/Archive.cpp
+++ b/llvm/lib/Object/Archive.cpp
@@ -269,11 +269,11 @@ Expected<StringRef> ArchiveMemberHeader::getName(uint64_t Size) const {
return Name;
// System libraries from the Windows SDK for Windows 11 contain this symbol.
// It looks like a CFG guard: we just skip it for now.
- if (Name.equals("/<XFGHASHMAP>/"))
+ if (Name == "/<XFGHASHMAP>/")
return Name;
// Some libraries (e.g., arm64rt.lib) from the Windows WDK
// (version 10.0.22000.0) contain this undocumented special member.
- if (Name.equals("/<ECSYMBOLS>/"))
+ if (Name == "/<ECSYMBOLS>/")
return Name;
// It's a long name.
// Get the string table offset.