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/cmExecProgramCommand.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/cmExecProgramCommand.cxx')
-rw-r--r-- | Source/cmExecProgramCommand.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 3c39816..88e085d 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -26,8 +26,8 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args, bool haveoutput_variable = false; std::string return_variable; bool havereturn_variable = false; - for (size_t i = 0; i < args.size(); ++i) { - if (args[i] == "OUTPUT_VARIABLE") { + for (std::string const& arg : args) { + if (arg == "OUTPUT_VARIABLE") { count++; doingargs = false; havereturn_variable = false; @@ -37,10 +37,10 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args, this->SetError("called with incorrect number of arguments"); return false; } - output_variable = args[i]; + output_variable = arg; haveoutput_variable = false; count++; - } else if (args[i] == "RETURN_VALUE") { + } else if (arg == "RETURN_VALUE") { count++; doingargs = false; haveoutput_variable = false; @@ -50,16 +50,16 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args, this->SetError("called with incorrect number of arguments"); return false; } - return_variable = args[i]; + return_variable = arg; havereturn_variable = false; count++; - } else if (args[i] == "ARGS") { + } else if (arg == "ARGS") { count++; havereturn_variable = false; haveoutput_variable = false; doingargs = true; } else if (doingargs) { - arguments += args[i]; + arguments += arg; arguments += " "; count++; } |