aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-04 08:46:48 -0700
committerGitHub <noreply@github.com>2024-05-04 08:46:48 -0700
commit7ee6288312e8cde8d2e8ee48f87bbab966a89247 (patch)
treeb1a582736229076e31a59e8fb391c31c3279eb05 /llvm/lib/Support/VirtualFileSystem.cpp
parent76aa042dde6ba9ba57c680950f5818259ee02690 (diff)
downloadllvm-7ee6288312e8cde8d2e8ee48f87bbab966a89247.zip
llvm-7ee6288312e8cde8d2e8ee48f87bbab966a89247.tar.gz
llvm-7ee6288312e8cde8d2e8ee48f87bbab966a89247.tar.bz2
[Support] Use StringRef::operator== instead of StringRef::equals (NFC) (#91042)
I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator== outnumbers StringRef::equals by a factor of 25 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/Support/VirtualFileSystem.cpp')
-rw-r--r--llvm/lib/Support/VirtualFileSystem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp
index 921af30..152fcfe 100644
--- a/llvm/lib/Support/VirtualFileSystem.cpp
+++ b/llvm/lib/Support/VirtualFileSystem.cpp
@@ -157,7 +157,7 @@ void FileSystem::dump() const { print(dbgs(), PrintType::RecursiveContents); }
#ifndef NDEBUG
static bool isTraversalComponent(StringRef Component) {
- return Component.equals("..") || Component.equals(".");
+ return Component == ".." || Component == ".";
}
static bool pathHasTraversal(StringRef Path) {