summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-01-22 10:39:02 -0500
committerBen Boeckel <ben.boeckel@kitware.com>2021-01-27 08:54:18 -0500
commitef935b17ab47739b1e81e9c6baf6112b7a20f9cb (patch)
tree7f31fc4bcf6efb450e67b29ba6713937515ca956 /Source/cmFindPackageCommand.cxx
parent9ac8dbbb941194e79fd59acfc4affa018a222745 (diff)
downloadcmake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.tar.gz
clang-tidy: fix `readability-use-anyofallof` warnings
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx29
1 files changed, 11 insertions, 18 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 3b7cf4c3eb..3719fe194b 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1145,34 +1145,27 @@ bool cmFindPackageCommand::FindConfig()
bool cmFindPackageCommand::FindPrefixedConfig()
{
std::vector<std::string> const& prefixes = this->SearchPaths;
- for (std::string const& p : prefixes) {
- if (this->SearchPrefix(p)) {
- return true;
- }
- }
- return false;
+ return std::any_of(
+ prefixes.begin(), prefixes.end(),
+ [this](std::string const& p) -> bool { return this->SearchPrefix(p); });
}
bool cmFindPackageCommand::FindFrameworkConfig()
{
std::vector<std::string> const& prefixes = this->SearchPaths;
- for (std::string const& p : prefixes) {
- if (this->SearchFrameworkPrefix(p)) {
- return true;
- }
- }
- return false;
+ return std::any_of(prefixes.begin(), prefixes.end(),
+ [this](std::string const& p) -> bool {
+ return this->SearchFrameworkPrefix(p);
+ });
}
bool cmFindPackageCommand::FindAppBundleConfig()
{
std::vector<std::string> const& prefixes = this->SearchPaths;
- for (std::string const& p : prefixes) {
- if (this->SearchAppBundlePrefix(p)) {
- return true;
- }
- }
- return false;
+ return std::any_of(prefixes.begin(), prefixes.end(),
+ [this](std::string const& p) -> bool {
+ return this->SearchAppBundlePrefix(p);
+ });
}
bool cmFindPackageCommand::ReadListFile(const std::string& f,