Skip to content

Commit 49cef79

Browse files
committed
Use llvm::any_of
1 parent be2fc1d commit 49cef79

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
@@ -509,13 +509,9 @@ int main(int argc, char **argv) {
509509
raw_ostream &OS = outs();
510510

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

520516
auto MaybePrintQuoted = [&](StringRef Str) {
521517
if (QuotePaths)

0 commit comments

Comments
 (0)