diff options
author | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-11 10:40:26 (GMT) |
---|---|---|
committer | Pavel Solodovnikov <hellyeahdominate@gmail.com> | 2017-09-12 13:22:47 (GMT) |
commit | 7d5095796ab616cf9b709036387bb95ab9984141 (patch) | |
tree | c010e922adad95ef86ab4a3ac2a3abd63e9f33ef /Source/cmExecuteProcessCommand.cxx | |
parent | 00975e926199eea21763470e2ab876246e36669a (diff) | |
download | CMake-7d5095796ab616cf9b709036387bb95ab9984141.zip CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.gz CMake-7d5095796ab616cf9b709036387bb95ab9984141.tar.bz2 |
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/cmExecuteProcessCommand.cxx')
-rw-r--r-- | Source/cmExecuteProcessCommand.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 22246b2..39e774e 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -170,13 +170,13 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, this->SetError(" called with no COMMAND argument."); return false; } - for (unsigned int i = 0; i < cmds.size(); ++i) { - if (cmds[i].empty()) { + for (auto& cmd : cmds) { + if (cmd.empty()) { this->SetError(" given COMMAND argument with no value."); return false; } // Add the null terminating pointer to the command argument list. - cmds[i].push_back(nullptr); + cmd.push_back(nullptr); } // Parse the timeout string. @@ -192,8 +192,8 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args, cmsysProcess* cp = cmsysProcess_New(); // Set the command sequence. - for (unsigned int i = 0; i < cmds.size(); ++i) { - cmsysProcess_AddCommand(cp, &*cmds[i].begin()); + for (auto const& cmd : cmds) { + cmsysProcess_AddCommand(cp, &*cmd.begin()); } // Set the process working directory. |