diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2021-01-22 15:39:02 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2021-01-27 13:54:18 (GMT) |
commit | ef935b17ab47739b1e81e9c6baf6112b7a20f9cb (patch) | |
tree | 7f31fc4bcf6efb450e67b29ba6713937515ca956 /Source/cmFindPackageCommand.cxx | |
parent | 9ac8dbbb941194e79fd59acfc4affa018a222745 (diff) | |
download | CMake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.zip CMake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.tar.gz CMake-ef935b17ab47739b1e81e9c6baf6112b7a20f9cb.tar.bz2 |
clang-tidy: fix `readability-use-anyofallof` warnings
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 3b7cf4c..3719fe1 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, |