cmMakefile: Add flag to result and manipulate in place.
Rather than creating a string, manipulating it, and then copying it to the result.
This commit is contained in:
parent
ee269f4f16
commit
f20a4257f2
@ -1340,11 +1340,11 @@ void cmMakefile::AddDefineFlag(const char* flag)
|
|||||||
void cmMakefile::AddDefineFlag(const char* flag, std::string& dflags)
|
void cmMakefile::AddDefineFlag(const char* flag, std::string& dflags)
|
||||||
{
|
{
|
||||||
// remove any \n\r
|
// remove any \n\r
|
||||||
std::string ret = flag;
|
std::string::size_type initSize = dflags.size();
|
||||||
std::replace(ret.begin(), ret.end(), '\n', ' ');
|
dflags += std::string(" ") + flag;
|
||||||
std::replace(ret.begin(), ret.end(), '\r', ' ');
|
std::string::iterator flagStart = dflags.begin() + initSize + 1;
|
||||||
dflags += " ";
|
std::replace(flagStart, dflags.end(), '\n', ' ');
|
||||||
dflags += ret;
|
std::replace(flagStart, dflags.end(), '\r', ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user