summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-09 08:34:48 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:25:12 (GMT)
commitbe87cb0c444595fa1970e257031252669c201d3e (patch)
tree76f818f89749c6b2547d0beaa965adf6b5760b48
parent425cd1670fdd40b752af71e5f28952ae4fcec4ac (diff)
downloadCMake-be87cb0c444595fa1970e257031252669c201d3e.zip
CMake-be87cb0c444595fa1970e257031252669c201d3e.tar.gz
CMake-be87cb0c444595fa1970e257031252669c201d3e.tar.bz2
cmLocalGenerator: Simplify loop with range algorithm
-rw-r--r--Source/cmLocalGenerator.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 138fe55..4f285cf 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -505,8 +505,7 @@ static const char* ruleReplaceVars[] = {
"CMAKE_CURRENT_BINARY_DIR",
"CMAKE_RANLIB",
"CMAKE_LINKER",
- "CMAKE_CL_SHOWINCLUDES_PREFIX",
- CM_NULLPTR
+ "CMAKE_CL_SHOWINCLUDES_PREFIX"
};
std::string cmLocalGenerator::ExpandRuleVariable(
@@ -693,12 +692,12 @@ std::string cmLocalGenerator::ExpandRuleVariable(
std::vector<std::string> enabledLanguages =
this->GetState()->GetEnabledLanguages();
// loop over language specific replace variables
- int pos = 0;
- while (ruleReplaceVars[pos]) {
+ for (const char* const* replaceIter = cmArrayBegin(ruleReplaceVars);
+ replaceIter != cmArrayEnd(ruleReplaceVars); ++replaceIter) {
for (std::vector<std::string>::iterator i = enabledLanguages.begin();
i != enabledLanguages.end(); ++i) {
const char* lang = i->c_str();
- std::string actualReplace = ruleReplaceVars[pos];
+ std::string actualReplace = *replaceIter;
// If this is the compiler then look for the extra variable
// _COMPILER_ARG1 which must be the first argument to the compiler
const char* compilerArg1 = CM_NULLPTR;
@@ -759,7 +758,6 @@ std::string cmLocalGenerator::ExpandRuleVariable(
return replace;
}
}
- pos++;
}
return variable;
}