diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-14 13:11:58 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-14 13:11:58 (GMT) |
commit | 63f6fd144ef0171864ddeccee6618ab179e90384 (patch) | |
tree | 36c602ec8b47cef4b0b72929958c5c19846ffb1e /Source/CTest/cmCTestGlobalVC.cxx | |
parent | 420874bfaa20772525c60b20d1ee5b6ef5ed9298 (diff) | |
download | CMake-63f6fd144ef0171864ddeccee6618ab179e90384.zip CMake-63f6fd144ef0171864ddeccee6618ab179e90384.tar.gz CMake-63f6fd144ef0171864ddeccee6618ab179e90384.tar.bz2 |
Meta: modernize old-fashioned loops to range-based `for` (CTest).
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
Diffstat (limited to 'Source/CTest/cmCTestGlobalVC.cxx')
-rw-r--r-- | Source/CTest/cmCTestGlobalVC.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestGlobalVC.cxx b/Source/CTest/cmCTestGlobalVC.cxx index 25294b5..d2714d90 100644 --- a/Source/CTest/cmCTestGlobalVC.cxx +++ b/Source/CTest/cmCTestGlobalVC.cxx @@ -48,15 +48,14 @@ void cmCTestGlobalVC::DoRevision(Revision const& revision, /* clang-format on */ // Update information about revisions of the changed files. - for (std::vector<Change>::const_iterator ci = changes.begin(); - ci != changes.end(); ++ci) { - if (const char* local = this->LocalPath(ci->Path)) { + for (Change const& c : changes) { + if (const char* local = this->LocalPath(c.Path)) { std::string dir = cmSystemTools::GetFilenamePath(local); std::string name = cmSystemTools::GetFilenameName(local); File& file = this->Dirs[dir][name]; file.PriorRev = file.Rev ? file.Rev : &this->PriorRev; file.Rev = &rev; - this->Log << " " << ci->Action << " " << local << " " + this->Log << " " << c.Action << " " << local << " " << "\n"; } } @@ -83,9 +82,9 @@ void cmCTestGlobalVC::WriteXMLDirectory(cmXMLWriter& xml, const char* slash = path.empty() ? "" : "/"; xml.StartElement("Directory"); xml.Element("Name", path); - for (Directory::const_iterator fi = dir.begin(); fi != dir.end(); ++fi) { - std::string full = path + slash + fi->first; - this->WriteXMLEntry(xml, path, fi->first, full, fi->second); + for (auto const& f : dir) { + std::string const full = path + slash + f.first; + this->WriteXMLEntry(xml, path, f.first, full, f.second); } xml.EndElement(); // Directory } @@ -114,10 +113,8 @@ bool cmCTestGlobalVC::WriteXMLUpdates(cmXMLWriter& xml) this->WriteXMLGlobal(xml); - for (std::map<std::string, Directory>::const_iterator di = - this->Dirs.begin(); - di != this->Dirs.end(); ++di) { - this->WriteXMLDirectory(xml, di->first, di->second); + for (auto const& d : this->Dirs) { + this->WriteXMLDirectory(xml, d.first, d.second); } return result; |