From: Benjamin Kramer Date: Sun, 31 May 2015 11:18:05 +0000 (+0000) Subject: [Format] Move UnwrappedLines instead of copying. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3982210b8dc173606739da561b78b24fbccb48a3;p=clang [Format] Move UnwrappedLines instead of copying. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@238673 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 662606cf4c..83cbe7642c 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/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::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(); } }