summaryrefslogtreecommitdiffstats
path: root/Source/cmFunctionCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-02-11 22:33:03 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-12 19:25:21 (GMT)
commit78757e7ffce9fb6297a2d501989e9b172e6151dc (patch)
treef16095d695d4c5eb73c3beb5448983cf2d899fbb /Source/cmFunctionCommand.cxx
parentfc1cf2654de04ed8f6954dc1907ab1dcb8bb946e (diff)
downloadCMake-78757e7ffce9fb6297a2d501989e9b172e6151dc.zip
CMake-78757e7ffce9fb6297a2d501989e9b172e6151dc.tar.gz
CMake-78757e7ffce9fb6297a2d501989e9b172e6151dc.tar.bz2
cmFunctionCommand: Replace loops with cmJoin.
Diffstat (limited to 'Source/cmFunctionCommand.cxx')
-rw-r--r--Source/cmFunctionCommand.cxx23
1 files changed, 4 insertions, 19 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 088a697..a4d9357 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -126,25 +126,10 @@ bool cmFunctionHelperCommand::InvokeInitialPass
}
// define ARGV and ARGN
- std::vector<std::string>::const_iterator eit;
- std::string argvDef;
- for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit )
- {
- if (!argvDef.empty())
- {
- argvDef += ";";
- }
- argvDef += *eit;
- }
- std::string argnDef;
- eit = expandedArgs.begin() + (this->Args.size()-1);
- for ( ; eit != expandedArgs.end(); ++eit)
- if (!argnDef.empty())
- {
- argnDef += ";";
- }
- argnDef += *eit;
- }
+ 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());