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/cpack.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/cpack.cxx')
-rw-r--r-- | Source/CPack/cpack.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index a31bc8b..33d03e5 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -293,10 +293,8 @@ int main(int argc, char const* const* argv) cpackProjectDirectory.c_str()); } } - cpackDefinitions::MapType::iterator cdit; - for (cdit = definitions.Map.begin(); cdit != definitions.Map.end(); - ++cdit) { - globalMF->AddDefinition(cdit->first, cdit->second.c_str()); + for (auto const& cd : definitions.Map) { + globalMF->AddDefinition(cd.first, cd.second.c_str()); } const char* cpackModulesPath = @@ -311,9 +309,7 @@ int main(int argc, char const* const* argv) } else { std::vector<std::string> generatorsVector; cmSystemTools::ExpandListArgument(genList, generatorsVector); - std::vector<std::string>::iterator it; - for (it = generatorsVector.begin(); it != generatorsVector.end(); ++it) { - const char* gen = it->c_str(); + for (std::string const& gen : generatorsVector) { cmMakefile::ScopePushPop raii(globalMF.get()); cmMakefile* mf = globalMF.get(); cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, @@ -413,12 +409,10 @@ int main(int argc, char const* const* argv) doc.PrependSection("Options", cmDocumentationOptions); std::vector<cmDocumentationEntry> v; - cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt; - for (generatorIt = generators.GetGeneratorsList().begin(); - generatorIt != generators.GetGeneratorsList().end(); ++generatorIt) { + for (auto const& g : generators.GetGeneratorsList()) { cmDocumentationEntry e; - e.Name = generatorIt->first; - e.Brief = generatorIt->second; + e.Name = g.first; + e.Brief = g.second; v.push_back(e); } doc.SetSection("Generators", v); |