diff options
author | Brad King <brad.king@kitware.com> | 2018-01-29 13:05:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-29 13:05:27 (GMT) |
commit | 92cd3d06772ada13935790d66927ab4663c7d628 (patch) | |
tree | 2550a2ad9003b47f9029c186aeabdfd6521bc615 /Source/cmGeneratorExpressionLexer.cxx | |
parent | 18153217e27d2cf560d874313557ec9fa2bcffdb (diff) | |
parent | c85bb007df37aad9f20355cdf4d7ca9af562cb20 (diff) | |
download | CMake-92cd3d06772ada13935790d66927ab4663c7d628.zip CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.gz CMake-92cd3d06772ada13935790d66927ab4663c7d628.tar.bz2 |
Merge topic 'reduce-temporaries'
c85bb007 Reduce allocation of temporary values on heap.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1698
Diffstat (limited to 'Source/cmGeneratorExpressionLexer.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionLexer.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmGeneratorExpressionLexer.cxx b/Source/cmGeneratorExpressionLexer.cxx index 931fd4d..95c79c1 100644 --- a/Source/cmGeneratorExpressionLexer.cxx +++ b/Source/cmGeneratorExpressionLexer.cxx @@ -12,8 +12,7 @@ static void InsertText(const char* upto, const char* c, std::vector<cmGeneratorExpressionToken>& result) { if (upto != c) { - result.push_back(cmGeneratorExpressionToken( - cmGeneratorExpressionToken::Text, upto, c - upto)); + result.emplace_back(cmGeneratorExpressionToken::Text, upto, c - upto); } } @@ -30,8 +29,8 @@ std::vector<cmGeneratorExpressionToken> cmGeneratorExpressionLexer::Tokenize( case '$': if (c[1] == '<') { InsertText(upto, c, result); - result.push_back(cmGeneratorExpressionToken( - cmGeneratorExpressionToken::BeginExpression, c, 2)); + result.emplace_back(cmGeneratorExpressionToken::BeginExpression, c, + 2); upto = c + 2; ++c; SawBeginExpression = true; @@ -39,21 +38,18 @@ std::vector<cmGeneratorExpressionToken> cmGeneratorExpressionLexer::Tokenize( break; case '>': InsertText(upto, c, result); - result.push_back(cmGeneratorExpressionToken( - cmGeneratorExpressionToken::EndExpression, c, 1)); + result.emplace_back(cmGeneratorExpressionToken::EndExpression, c, 1); upto = c + 1; SawGeneratorExpression = SawBeginExpression; break; case ':': InsertText(upto, c, result); - result.push_back(cmGeneratorExpressionToken( - cmGeneratorExpressionToken::ColonSeparator, c, 1)); + result.emplace_back(cmGeneratorExpressionToken::ColonSeparator, c, 1); upto = c + 1; break; case ',': InsertText(upto, c, result); - result.push_back(cmGeneratorExpressionToken( - cmGeneratorExpressionToken::CommaSeparator, c, 1)); + result.emplace_back(cmGeneratorExpressionToken::CommaSeparator, c, 1); upto = c + 1; break; default: |