summaryrefslogtreecommitdiff
path: root/lldb/source/Core/Module.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2020-03-31 20:56:24 +0200
committerBenjamin Kramer <benny.kra@googlemail.com>2020-03-31 21:01:09 +0200
commite8f13f4f62f52067cadb55f3c746ccf9d26ee2ce (patch)
treede0e5c0cb32349d5c6ffcf2811d0fa05e4607897 /lldb/source/Core/Module.cpp
parent03f43b3aca363e16c45d8733400fd0083b1af4d8 (diff)
Replace std::string::find == 0 with StringRef::startswith
This is both more readable and faster. Found by clang-tidy's abseil-string-find-startswith.
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r--lldb/source/Core/Module.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index cff74dc9d518..fefc23a9b1c5 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1414,7 +1414,7 @@ void Module::SetSymbolFileFileSpec(const FileSpec &file) {
if (FileSystem::Instance().IsDirectory(file)) {
std::string new_path(file.GetPath());
std::string old_path(obj_file->GetFileSpec().GetPath());
- if (old_path.find(new_path) == 0) {
+ if (llvm::StringRef(old_path).startswith(new_path)) {
// We specified the same bundle as the symbol file that we already
// have
return;