Skip to content

Commit 4cf3f03

Browse files
authored
[clang-tidy] use llvm::any_of refactor getAnalyzerCheckersAndPackages [NFC] (llvm#91713)
1 parent 195d8ac commit 4cf3f03

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,11 @@ static CheckersList getAnalyzerCheckersAndPackages(ClangTidyContext &Context,
373373

374374
const auto &RegisteredCheckers =
375375
AnalyzerOptions::getRegisteredCheckers(IncludeExperimental);
376-
bool AnalyzerChecksEnabled = false;
377-
for (StringRef CheckName : RegisteredCheckers) {
378-
std::string ClangTidyCheckName((AnalyzerCheckNamePrefix + CheckName).str());
379-
AnalyzerChecksEnabled |= Context.isCheckEnabled(ClangTidyCheckName);
380-
}
376+
const bool AnalyzerChecksEnabled =
377+
llvm::any_of(RegisteredCheckers, [&](StringRef CheckName) -> bool {
378+
return Context.isCheckEnabled(
379+
(AnalyzerCheckNamePrefix + CheckName).str());
380+
});
381381

382382
if (!AnalyzerChecksEnabled)
383383
return List;

0 commit comments

Comments
 (0)