diff options
author | Kazu Hirata <kazu@google.com> | 2021-10-23 08:45:27 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-10-23 08:45:27 -0700 |
commit | d14d7068b6b4a141f33edd7f135da238b580cca6 (patch) | |
tree | 49b79a0dc433e41e9173e616d6d20e36eb04b7a0 /llvm/lib/Support/Unix/Program.inc | |
parent | 878060aaf9650e4c8faa9dca6bae6e09621e70e1 (diff) | |
download | llvm-d14d7068b6b4a141f33edd7f135da238b580cca6.zip llvm-d14d7068b6b4a141f33edd7f135da238b580cca6.tar.gz llvm-d14d7068b6b4a141f33edd7f135da238b580cca6.tar.bz2 |
[llvm] Use StringRef::contains (NFC)
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r-- | llvm/lib/Support/Unix/Program.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc index be59bb0..0893420 100644 --- a/llvm/lib/Support/Unix/Program.inc +++ b/llvm/lib/Support/Unix/Program.inc @@ -71,7 +71,8 @@ ErrorOr<std::string> sys::findProgramByName(StringRef Name, assert(!Name.empty() && "Must have a name!"); // Use the given path verbatim if it contains any slashes; this matches // the behavior of sh(1) and friends. - if (Name.find('/') != StringRef::npos) return std::string(Name); + if (Name.contains('/')) + return std::string(Name); SmallVector<StringRef, 16> EnvironmentPaths; if (Paths.empty()) |