Skip to content

Commit 93e91a6

Browse files
committed
Use llvm::any_of
1 parent e74923f commit 93e91a6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/tools/llvm-config/llvm-config.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,9 @@ int main(int argc, char **argv) {
507507
raw_ostream &OS = outs();
508508

509509
// Check if we want quoting and escaping.
510-
bool QuotePaths = false;
511-
for (int i = 1; i != argc; ++i) {
512-
if (StringRef(argv[i]) == "--quote-paths") {
513-
QuotePaths = true;
514-
break;
515-
}
516-
}
510+
bool QuotePaths = std::any_of(&argv[0], &argv[argc], [](const char *Arg) {
511+
return StringRef(Arg) == "--quote-paths";
512+
});
517513

518514
auto MaybePrintQuoted = [&](StringRef Str) {
519515
if (QuotePaths)

0 commit comments

Comments
 (0)