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/cmCTestLaunch.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/cmCTestLaunch.cxx')
-rw-r--r-- | Source/CTest/cmCTestLaunch.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx index 041cc92..453ae99 100644 --- a/Source/CTest/cmCTestLaunch.cxx +++ b/Source/CTest/cmCTestLaunch.cxx @@ -169,9 +169,8 @@ void cmCTestLaunch::ComputeFileNames() cmCryptoHash md5(cmCryptoHash::AlgoMD5); md5.Initialize(); md5.Append(this->CWD); - for (std::vector<std::string>::const_iterator ai = this->RealArgs.begin(); - ai != this->RealArgs.end(); ++ai) { - md5.Append(*ai); + for (std::string const& realArg : this->RealArgs) { + md5.Append(realArg); } this->LogHash = md5.FinalizeHex(); @@ -422,9 +421,8 @@ void cmCTestLaunch::WriteXMLCommand(cmXMLWriter& xml) if (!this->CWD.empty()) { xml.Element("WorkingDirectory", this->CWD); } - for (std::vector<std::string>::const_iterator ai = this->RealArgs.begin(); - ai != this->RealArgs.end(); ++ai) { - xml.Element("Argument", *ai); + for (std::string const& realArg : this->RealArgs) { + xml.Element("Argument", realArg); } xml.EndElement(); // Command } @@ -487,9 +485,8 @@ void cmCTestLaunch::WriteXMLLabels(cmXMLWriter& xml) if (!this->Labels.empty()) { xml.Comment("Interested parties"); xml.StartElement("Labels"); - for (std::set<std::string>::const_iterator li = this->Labels.begin(); - li != this->Labels.end(); ++li) { - xml.Element("Label", *li); + for (std::string const& label : this->Labels) { + xml.Element("Label", label); } xml.EndElement(); // Labels } @@ -597,9 +594,8 @@ bool cmCTestLaunch::ScrapeLog(std::string const& fname) bool cmCTestLaunch::Match(std::string const& line, std::vector<cmsys::RegularExpression>& regexps) { - for (std::vector<cmsys::RegularExpression>::iterator ri = regexps.begin(); - ri != regexps.end(); ++ri) { - if (ri->find(line.c_str())) { + for (cmsys::RegularExpression& r : regexps) { + if (r.find(line.c_str())) { return true; } } |