diff options
author | Brad King <brad.king@kitware.com> | 2015-02-13 16:03:00 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-02-13 16:03:00 (GMT) |
commit | d6616181c86770f7dc36343a5bacfafe853ea8e7 (patch) | |
tree | db03aa72a259ebb0663b44be48bccec46443b497 | |
parent | cc90fd58eca493151010b81914f4c9cfafae145c (diff) | |
parent | 78757e7ffce9fb6297a2d501989e9b172e6151dc (diff) | |
download | CMake-d6616181c86770f7dc36343a5bacfafe853ea8e7.zip CMake-d6616181c86770f7dc36343a5bacfafe853ea8e7.tar.gz CMake-d6616181c86770f7dc36343a5bacfafe853ea8e7.tar.bz2 |
Merge topic 'clean-up-cmFunctionCommand'
78757e7f cmFunctionCommand: Replace loops with cmJoin.
fc1cf265 cmFunctionCommand: Remove counting variable.
e5ebeae7 cmFunctionCommand: Split loop in two.
-rw-r--r-- | Source/cmFunctionCommand.cxx | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index b44e228..a4d9357 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -126,27 +126,10 @@ bool cmFunctionHelperCommand::InvokeInitialPass } // define ARGV and ARGN - std::vector<std::string>::const_iterator eit; - std::string argvDef; - std::string argnDef; - unsigned int cnt = 0; - for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit ) - { - if (!argvDef.empty()) - { - argvDef += ";"; - } - argvDef += *eit; - if ( cnt >= this->Args.size()-1 ) - { - if (!argnDef.empty()) - { - argnDef += ";"; - } - argnDef += *eit; - } - cnt ++; - } + std::string argvDef = cmJoin(expandedArgs, ";"); + std::vector<std::string>::const_iterator eit + = expandedArgs.begin() + (this->Args.size()-1); + std::string argnDef = cmJoin(cmRange(eit, expandedArgs.end()), ";"); this->Makefile->AddDefinition("ARGV", argvDef.c_str()); this->Makefile->MarkVariableAsUsed("ARGV"); this->Makefile->AddDefinition("ARGN", argnDef.c_str()); |