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/cmCTestCVS.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/cmCTestCVS.cxx')
-rw-r--r-- | Source/CTest/cmCTestCVS.cxx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx index f2a9a85..6eeb135 100644 --- a/Source/CTest/cmCTestCVS.cxx +++ b/Source/CTest/cmCTestCVS.cxx @@ -92,9 +92,8 @@ bool cmCTestCVS::UpdateImpl() cvs_update.push_back(this->CommandLineTool.c_str()); cvs_update.push_back("-z3"); cvs_update.push_back("update"); - for (std::vector<std::string>::const_iterator ai = args.begin(); - ai != args.end(); ++ai) { - cvs_update.push_back(ai->c_str()); + for (std::string const& arg : args) { + cvs_update.push_back(arg.c_str()); } cvs_update.push_back(nullptr); @@ -242,12 +241,12 @@ void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path, // Load revisions and write an entry for each file in this directory. std::vector<Revision> revisions; - for (Directory::const_iterator fi = dir.begin(); fi != dir.end(); ++fi) { - std::string full = path + slash + fi->first; + for (auto const& fi : dir) { + std::string full = path + slash + fi.first; // Load two real or unknown revisions. revisions.clear(); - if (fi->second != PathUpdated) { + if (fi.second != PathUpdated) { // For local modifications the current rev is unknown and the // prior rev is the latest from cvs. revisions.push_back(this->Unknown); @@ -256,8 +255,8 @@ void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path, revisions.resize(2, this->Unknown); // Write the entry for this file with these revisions. - File f(fi->second, &revisions[0], &revisions[1]); - this->WriteXMLEntry(xml, path, fi->first, full, f); + File f(fi.second, &revisions[0], &revisions[1]); + this->WriteXMLEntry(xml, path, fi.first, full, f); } xml.EndElement(); // Directory } @@ -269,10 +268,8 @@ bool cmCTestCVS::WriteXMLUpdates(cmXMLWriter& xml) " " << std::flush); - 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); } cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl); |