diff options
author | Brad King <brad.king@kitware.com> | 2017-09-19 13:07:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-19 13:07:48 (GMT) |
commit | 4547d9a83030f8ae7e636cef16a261c65e6feb40 (patch) | |
tree | 3b695694b889d506c61d010102e3824e89e39581 /Source/CPack/IFW/cmCPackIFWGenerator.cxx | |
parent | 7c28081c147e2eb6c7ad6dee0aada77219af7a6d (diff) | |
parent | f43baf69814176f52b2b229667c4d3e88154bdea (diff) | |
download | CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.zip CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.tar.gz CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.tar.bz2 |
Merge topic 'ranged-for'
f43baf69 Meta: modernize old-fashioned loops to range-based `for` (CPack).
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1274
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWGenerator.cxx')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 574c9cf..825a888 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -49,19 +49,15 @@ int cmCPackIFWGenerator::PackageFiles() ifwCmd += " -p " + this->toplevel + "/packages"; if (!this->PkgsDirsVector.empty()) { - for (std::vector<std::string>::iterator it = - this->PkgsDirsVector.begin(); - it != this->PkgsDirsVector.end(); ++it) { - ifwCmd += " -p " + *it; + for (std::string const& it : this->PkgsDirsVector) { + ifwCmd += " -p " + it; } } if (!this->RepoDirsVector.empty()) { if (!this->IsVersionLess("3.1")) { - for (std::vector<std::string>::iterator it = - this->RepoDirsVector.begin(); - it != this->RepoDirsVector.end(); ++it) { - ifwCmd += " --repository " + *it; + for (std::string const& rd : this->RepoDirsVector) { + ifwCmd += " --repository " + rd; } } else { cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " @@ -137,19 +133,15 @@ int cmCPackIFWGenerator::PackageFiles() ifwCmd += " -p " + this->toplevel + "/packages"; if (!this->PkgsDirsVector.empty()) { - for (std::vector<std::string>::iterator it = - this->PkgsDirsVector.begin(); - it != this->PkgsDirsVector.end(); ++it) { - ifwCmd += " -p " + *it; + for (std::string const& it : this->PkgsDirsVector) { + ifwCmd += " -p " + it; } } if (!this->RepoDirsVector.empty()) { if (!this->IsVersionLess("3.1")) { - for (std::vector<std::string>::iterator it = - this->RepoDirsVector.begin(); - it != this->RepoDirsVector.end(); ++it) { - ifwCmd += " --repository " + *it; + for (std::string const& rd : this->RepoDirsVector) { + ifwCmd += " --repository " + rd; } } else { cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " @@ -321,9 +313,8 @@ int cmCPackIFWGenerator::InitializeInternal() if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) { std::vector<std::string> RepoAllVector; cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector); - for (std::vector<std::string>::iterator rit = RepoAllVector.begin(); - rit != RepoAllVector.end(); ++rit) { - this->GetRepository(*rit); + for (std::string const& r : RepoAllVector) { + this->GetRepository(r); } } |