diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-01-16 06:13:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-17 18:12:02 (GMT) |
commit | ef61997b1be5c2f542472f8eb48dac62cd26bf5c (patch) | |
tree | 3d17442b633d74e8e18f4f4c48578f3b639d25be /Source/cmStringReplaceHelper.cxx | |
parent | 2e5307a2a45d456b7fb52e4d3fab1416dc9a1bd8 (diff) | |
download | CMake-ef61997b1be5c2f542472f8eb48dac62cd26bf5c.zip CMake-ef61997b1be5c2f542472f8eb48dac62cd26bf5c.tar.gz CMake-ef61997b1be5c2f542472f8eb48dac62cd26bf5c.tar.bz2 |
clang-tidy: Use emplace
Diffstat (limited to 'Source/cmStringReplaceHelper.cxx')
-rw-r--r-- | Source/cmStringReplaceHelper.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmStringReplaceHelper.cxx b/Source/cmStringReplaceHelper.cxx index 69b7ced..f50cf58 100644 --- a/Source/cmStringReplaceHelper.cxx +++ b/Source/cmStringReplaceHelper.cxx @@ -85,10 +85,12 @@ void cmStringReplaceHelper::ParseReplaceExpression() auto r = this->ReplaceExpression.find('\\', l); if (r == std::string::npos) { r = this->ReplaceExpression.length(); - this->Replacements.push_back(this->ReplaceExpression.substr(l, r - l)); + this->Replacements.emplace_back( + this->ReplaceExpression.substr(l, r - l)); } else { if (r - l > 0) { - this->Replacements.push_back(this->ReplaceExpression.substr(l, r - l)); + this->Replacements.emplace_back( + this->ReplaceExpression.substr(l, r - l)); } if (r == (this->ReplaceExpression.length() - 1)) { this->ValidReplaceExpression = false; @@ -97,11 +99,11 @@ void cmStringReplaceHelper::ParseReplaceExpression() } if ((this->ReplaceExpression[r + 1] >= '0') && (this->ReplaceExpression[r + 1] <= '9')) { - this->Replacements.push_back(this->ReplaceExpression[r + 1] - '0'); + this->Replacements.emplace_back(this->ReplaceExpression[r + 1] - '0'); } else if (this->ReplaceExpression[r + 1] == 'n') { - this->Replacements.push_back("\n"); + this->Replacements.emplace_back("\n"); } else if (this->ReplaceExpression[r + 1] == '\\') { - this->Replacements.push_back("\\"); + this->Replacements.emplace_back("\\"); } else { this->ValidReplaceExpression = false; std::ostringstream error; |