diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-05-31 11:18:05 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-05-31 11:18:05 +0000 |
commit | c7551a4843e84abfd5fa0fbd056f5f1ec96c86ae (patch) | |
tree | 0f9eb1e3af1113d99b6b10d690c019770bca9dd1 /clang/lib | |
parent | be520bd1a609778bcadd1adecd22ee2f3cb16c07 (diff) | |
download | bcm5719-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.cpp | 11 |
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(); } } |