summaryrefslogtreecommitdiff
path: root/Source/cmWhileCommand.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-11 13:40:26 +0300
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-12 16:22:47 +0300
commit7d5095796ab616cf9b709036387bb95ab9984141 (patch)
treec010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmWhileCommand.cxx
parent00975e926199eea21763470e2ab876246e36669a (diff)
downloadcmake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz
Meta: modernize old-fashioned loops to range-based `for`.
Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r--Source/cmWhileCommand.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 24d7bf1bfc..172ac62eb3 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -60,11 +60,10 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
while (isTrue) {
if (!errorString.empty()) {
std::string err = "had incorrect arguments: ";
- unsigned int i;
- for (i = 0; i < this->Args.size(); ++i) {
- err += (this->Args[i].Delim ? "\"" : "");
- err += this->Args[i].Value;
- err += (this->Args[i].Delim ? "\"" : "");
+ for (cmListFileArgument const& arg : this->Args) {
+ err += (arg.Delim ? "\"" : "");
+ err += arg.Value;
+ err += (arg.Delim ? "\"" : "");
err += " ";
}
err += "(";
@@ -78,9 +77,9 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
}
// Invoke all the functions that were collected in the block.
- for (unsigned int c = 0; c < this->Functions.size(); ++c) {
+ for (cmListFileFunction const& fn : this->Functions) {
cmExecutionStatus status;
- mf.ExecuteCommand(this->Functions[c], status);
+ mf.ExecuteCommand(fn, status);
if (status.GetReturnInvoked()) {
inStatus.SetReturnInvoked();
return true;