diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-17 23:40:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-18 22:45:19 (GMT) |
commit | ee269f4f16300b0427c1e1baef94b85ccc4ea13f (patch) | |
tree | da4a70ca23b85cdb85705978f31aa38b3b7f3665 /Source | |
parent | 470cff497bc26d48ee05de0b260af2546bb7698c (diff) | |
download | CMake-ee269f4f16300b0427c1e1baef94b85ccc4ea13f.zip CMake-ee269f4f16300b0427c1e1baef94b85ccc4ea13f.tar.gz CMake-ee269f4f16300b0427c1e1baef94b85ccc4ea13f.tar.bz2 |
cmMakefile: Replace two loops with std::replace.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefile.cxx | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2085a97..0d0c60a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1341,19 +1341,8 @@ void cmMakefile::AddDefineFlag(const char* flag, std::string& dflags) { // remove any \n\r std::string ret = flag; - std::string::size_type pos = 0; - while((pos = ret.find('\n', pos)) != std::string::npos) - { - ret[pos] = ' '; - pos++; - } - pos = 0; - while((pos = ret.find('\r', pos)) != std::string::npos) - { - ret[pos] = ' '; - pos++; - } - + std::replace(ret.begin(), ret.end(), '\n', ' '); + std::replace(ret.begin(), ret.end(), '\r', ' '); dflags += " "; dflags += ret; } |