diff options
author | Brad King <brad.king@kitware.com> | 2019-02-11 13:08:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-11 13:08:22 (GMT) |
commit | 4b37b4f1bb785a305ab742f37e5268d4cffef693 (patch) | |
tree | f9c6e15ac0925bfa8b15fce4c3475d3233a820f6 /Source/cmGlobalGenerator.cxx | |
parent | 17de1eea806d7ba87a4ba6ad1073ced5f7ea9473 (diff) | |
parent | 01b2d6ab7465e7f22fb821876027df86b0c8f363 (diff) | |
download | CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.zip CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.gz CMake-4b37b4f1bb785a305ab742f37e5268d4cffef693.tar.bz2 |
Merge topic 'modernize-for-loops'
01b2d6ab74 Modernize: Use ranged for-loops when possible
15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !2901
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 50d361e..8e7ca12 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -314,9 +314,11 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const if (configs.empty()) { target->GetSourceFiles(srcs, ""); } else { - for (std::vector<std::string>::const_iterator ci = configs.begin(); - ci != configs.end() && srcs.empty(); ++ci) { - target->GetSourceFiles(srcs, *ci); + for (std::string const& config : configs) { + target->GetSourceFiles(srcs, config); + if (srcs.empty()) { + break; + } } } if (srcs.empty()) { @@ -2984,10 +2986,8 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) } std::vector<cmSourceFile*>::const_iterator sourcesEnd = cmRemoveDuplicates(sources); - for (std::vector<cmSourceFile*>::const_iterator si = sources.begin(); - si != sourcesEnd; ++si) { + for (cmSourceFile* sf : cmMakeRange(sources.cbegin(), sourcesEnd)) { Json::Value& lj_source = lj_sources.append(Json::objectValue); - cmSourceFile* sf = *si; std::string const& sfp = sf->GetFullPath(); fout << sfp << "\n"; lj_source["file"] = sfp; |