Skip to content

Commit c06f864

Browse files
[ExecutionEngine] Use StringRef::starts_with (NFC) (#167152)
Identified with modernize-use-starts-ends-with.
1 parent 18b8e3b commit c06f864

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ std::string LibraryScanHelper::resolveCanonical(StringRef Path,
768768
PathType LibraryScanHelper::classifyKind(StringRef Path) const {
769769
// Detect home directory
770770
const char *Home = getenv("HOME");
771-
if (Home && Path.find(Home) == 0)
771+
if (Home && Path.starts_with(Home))
772772
return PathType::User;
773773

774774
static const std::array<std::string, 5> UserPrefixes = {
@@ -780,7 +780,7 @@ PathType LibraryScanHelper::classifyKind(StringRef Path) const {
780780
};
781781

782782
for (const auto &Prefix : UserPrefixes) {
783-
if (Path.find(Prefix) == 0)
783+
if (Path.starts_with(Prefix))
784784
return PathType::User;
785785
}
786786

0 commit comments

Comments
 (0)