summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-05-31 11:18:05 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-05-31 11:18:05 +0000
commitc7551a4843e84abfd5fa0fbd056f5f1ec96c86ae (patch)
tree0f9eb1e3af1113d99b6b10d690c019770bca9dd1 /clang/lib
parentbe520bd1a609778bcadd1adecd22ee2f3cb16c07 (diff)
downloadbcm5719-llvm-c7551a4843e84abfd5fa0fbd056f5f1ec96c86ae.tar.gz
bcm5719-llvm-c7551a4843e84abfd5fa0fbd056f5f1ec96c86ae.zip
[Format] Move UnwrappedLines instead of copying.
No functional change intended. llvm-svn: 238673
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 662606cf4cc..83cbe7642cb 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -1762,15 +1762,12 @@ void UnwrappedLineParser::addUnwrappedLine() {
if (CurrentLines == &Lines)
printDebugInfo(*Line);
});
- CurrentLines->push_back(*Line);
+ CurrentLines->push_back(std::move(*Line));
Line->Tokens.clear();
if (CurrentLines == &Lines && !PreprocessorDirectives.empty()) {
- for (SmallVectorImpl<UnwrappedLine>::iterator
- I = PreprocessorDirectives.begin(),
- E = PreprocessorDirectives.end();
- I != E; ++I) {
- CurrentLines->push_back(*I);
- }
+ CurrentLines->append(
+ std::make_move_iterator(PreprocessorDirectives.begin()),
+ std::make_move_iterator(PreprocessorDirectives.end()));
PreprocessorDirectives.clear();
}
}
OpenPOWER on IntegriCloud