summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestGIT.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-14 13:11:58 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-14 13:11:58 (GMT)
commit63f6fd144ef0171864ddeccee6618ab179e90384 (patch)
tree36c602ec8b47cef4b0b72929958c5c19846ffb1e /Source/CTest/cmCTestGIT.cxx
parent420874bfaa20772525c60b20d1ee5b6ef5ed9298 (diff)
downloadCMake-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/cmCTestGIT.cxx')
-rw-r--r--Source/CTest/cmCTestGIT.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index ed8d932..fa5388a 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -163,9 +163,8 @@ bool cmCTestGIT::UpdateByFetchAndReset()
opts = this->CTest->GetCTestConfiguration("GITUpdateOptions");
}
std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
- for (std::vector<std::string>::const_iterator ai = args.begin();
- ai != args.end(); ++ai) {
- git_fetch.push_back(ai->c_str());
+ for (std::string const& arg : args) {
+ git_fetch.push_back(arg.c_str());
}
// Sentinel argument.
@@ -215,9 +214,8 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom)
std::vector<std::string> git_custom_command;
cmSystemTools::ExpandListArgument(custom, git_custom_command, true);
std::vector<char const*> git_custom;
- for (std::vector<std::string>::const_iterator i = git_custom_command.begin();
- i != git_custom_command.end(); ++i) {
- git_custom.push_back(i->c_str());
+ for (std::string const& i : git_custom_command) {
+ git_custom.push_back(i.c_str());
}
git_custom.push_back(nullptr);
@@ -655,9 +653,8 @@ bool cmCTestGIT::LoadModifications()
OutputLogger err(this->Log, "di-err> ");
this->RunChild(git_diff_index, &out, &err, nullptr, cmProcessOutput::UTF8);
- for (std::vector<Change>::const_iterator ci = out.Changes.begin();
- ci != out.Changes.end(); ++ci) {
- this->DoModification(PathModified, ci->Path);
+ for (Change const& c : out.Changes) {
+ this->DoModification(PathModified, c.Path);
}
return true;
}