summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2019-02-07 21:39:05 (GMT)
committerArtur Ryt <artur.ryt@gmail.com>2019-02-07 21:39:05 (GMT)
commit01b2d6ab7465e7f22fb821876027df86b0c8f363 (patch)
tree7ae313670e3655269ef7f9db6feabdc4bb2aaf25 /Source/cmGlobalGenerator.cxx
parent15bdbec0176e3aa620bb5bda3631819c5ca18eaf (diff)
downloadCMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.zip
CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.gz
CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.bz2
Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 386a3f7..e56dc4c 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()) {
@@ -2983,10 +2985,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;