mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 22:10:32 +00:00
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)
|
||||
{
|
||||
// remove any \n\r
|
||||
std::string ret = flag;
|
||||
std::replace(ret.begin(), ret.end(), '\n', ' ');
|
||||
std::replace(ret.begin(), ret.end(), '\r', ' ');
|
||||
dflags += " ";
|
||||
dflags += ret;
|
||||
std::string::size_type initSize = dflags.size();
|
||||
dflags += std::string(" ") + flag;
|
||||
std::string::iterator flagStart = dflags.begin() + initSize + 1;
|
||||
std::replace(flagStart, dflags.end(), '\n', ' ');
|
||||
std::replace(flagStart, dflags.end(), '\r', ' ');
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user