cmFunctionCommand: Replace loops with cmJoin.

This commit is contained in:
Stephen Kelly 2015-02-11 23:33:03 +01:00
parent fc1cf2654d
commit 78757e7ffc
1 changed files with 4 additions and 19 deletions

View File

@ -126,25 +126,10 @@ bool cmFunctionHelperCommand::InvokeInitialPass
} }
// define ARGV and ARGN // define ARGV and ARGN
std::vector<std::string>::const_iterator eit; std::string argvDef = cmJoin(expandedArgs, ";");
std::string argvDef; std::vector<std::string>::const_iterator eit
for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit ) = expandedArgs.begin() + (this->Args.size()-1);
{ std::string argnDef = cmJoin(cmRange(eit, expandedArgs.end()), ";");
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;
}
this->Makefile->AddDefinition("ARGV", argvDef.c_str()); this->Makefile->AddDefinition("ARGV", argvDef.c_str());
this->Makefile->MarkVariableAsUsed("ARGV"); this->Makefile->MarkVariableAsUsed("ARGV");
this->Makefile->AddDefinition("ARGN", argnDef.c_str()); this->Makefile->AddDefinition("ARGN", argnDef.c_str());