diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-10-09 08:34:48 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-10-15 09:25:12 (GMT) |
commit | be87cb0c444595fa1970e257031252669c201d3e (patch) | |
tree | 76f818f89749c6b2547d0beaa965adf6b5760b48 /Source | |
parent | 425cd1670fdd40b752af71e5f28952ae4fcec4ac (diff) | |
download | CMake-be87cb0c444595fa1970e257031252669c201d3e.zip CMake-be87cb0c444595fa1970e257031252669c201d3e.tar.gz CMake-be87cb0c444595fa1970e257031252669c201d3e.tar.bz2 |
cmLocalGenerator: Simplify loop with range algorithm
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 10 |
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; } |