Convert loops to cmJoin algorithm with cmRange.
This commit is contained in:
parent
bb10012fea
commit
9380e85f86
|
@ -259,14 +259,7 @@ bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args)
|
||||||
{
|
{
|
||||||
listString += ";";
|
listString += ";";
|
||||||
}
|
}
|
||||||
const char* sep = "";
|
listString += cmJoin(cmRange(args).advance(2), ";");
|
||||||
size_t cc;
|
|
||||||
for ( cc = 2; cc < args.size(); ++ cc )
|
|
||||||
{
|
|
||||||
listString += sep;
|
|
||||||
listString += args[cc];
|
|
||||||
sep = ";";
|
|
||||||
}
|
|
||||||
|
|
||||||
this->Makefile->AddDefinition(listName, listString.c_str());
|
this->Makefile->AddDefinition(listName, listString.c_str());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -3016,13 +3016,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
|
||||||
{
|
{
|
||||||
relative += "/";
|
relative += "/";
|
||||||
}
|
}
|
||||||
const char* sep = "";
|
relative += cmJoin(cmRange(remote).advance(common), "/");
|
||||||
for(unsigned int i=common; i < remote.size(); ++i)
|
|
||||||
{
|
|
||||||
relative += sep;
|
|
||||||
relative += remote[i];
|
|
||||||
sep = "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finally return the path.
|
// Finally return the path.
|
||||||
return relative;
|
return relative;
|
||||||
|
|
|
@ -172,12 +172,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
|
||||||
}
|
}
|
||||||
std::vector<std::string>::const_iterator eit
|
std::vector<std::string>::const_iterator eit
|
||||||
= expandedArgs.begin() + (this->Args.size() - 1);
|
= expandedArgs.begin() + (this->Args.size() - 1);
|
||||||
const char* sep = "";
|
argnDef += cmJoin(cmRange(eit, expandedArgs.end()), ";");
|
||||||
for( ; eit != expandedArgs.end(); ++eit)
|
|
||||||
{
|
|
||||||
argnDef += sep + *eit;
|
|
||||||
sep = ";";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
argnDefInitialized = true;
|
argnDefInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,12 +406,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
// Clock command
|
// Clock command
|
||||||
else if (args[1] == "time" && args.size() > 2)
|
else if (args[1] == "time" && args.size() > 2)
|
||||||
{
|
{
|
||||||
std::string command = args[2];
|
std::string command = cmJoin(cmRange(args).advance(2), " ");
|
||||||
for (std::string::size_type cc = 3; cc < args.size(); cc ++)
|
|
||||||
{
|
|
||||||
command += " ";
|
|
||||||
command += args[cc];
|
|
||||||
}
|
|
||||||
|
|
||||||
clock_t clock_start, clock_finish;
|
clock_t clock_start, clock_finish;
|
||||||
time_t time_start, time_finish;
|
time_t time_start, time_finish;
|
||||||
|
@ -473,14 +468,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string command = "\"";
|
std::string command = "\"";
|
||||||
command += args[3];
|
command += cmJoin(cmRange(args).advance(3), "\" \"");
|
||||||
command += "\"";
|
command += "\"";
|
||||||
for (std::string::size_type cc = 4; cc < args.size(); cc ++)
|
|
||||||
{
|
|
||||||
command += " \"";
|
|
||||||
command += args[cc];
|
|
||||||
command += "\"";
|
|
||||||
}
|
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
int timeout = 0;
|
int timeout = 0;
|
||||||
if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, &retval,
|
if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, &retval,
|
||||||
|
|
Loading…
Reference in New Issue