[Format] Move UnwrappedLines instead of copying.

No functional change intended.

llvm-svn: 238673
This commit is contained in:
Benjamin Kramer 2015-05-31 11:18:05 +00:00
parent be520bd1a6
commit c7551a4843
1 changed files with 4 additions and 7 deletions

View File

@ -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();
}
}