summaryrefslogtreecommitdiffstats
path: root/Source/cmExecProgramCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-13 12:34:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-13 12:35:05 (GMT)
commit67810849b95acfe036a9a605dbda6f0a3d6f7493 (patch)
treefa63356603dd00956f306eb92d4ecdbca9e450d4 /Source/cmExecProgramCommand.cxx
parenta763cffd6b65bbe5572527e39969981bf31d5aca (diff)
parent7d5095796ab616cf9b709036387bb95ab9984141 (diff)
downloadCMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.zip
CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.tar.gz
CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.tar.bz2
Merge topic 'ranged-for'
7d509579 Meta: modernize old-fashioned loops to range-based `for`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1249
Diffstat (limited to 'Source/cmExecProgramCommand.cxx')
-rw-r--r--Source/cmExecProgramCommand.cxx14
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++;
}