[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-commits
Subject: r238673 - [Format] Move UnwrappedLines instead of copying.
From: Benjamin Kramer <benny.kra () googlemail ! com>
Date: 2015-05-31 11:18:05
Message-ID: 20150531111805.D239F2A6C02B () llvm ! org
[Download RAW message or body]
Author: d0k
Date: Sun May 31 06:18:05 2015
New Revision: 238673
URL: http://llvm.org/viewvc/llvm-project?rev=238673&view=rev
Log:
[Format] Move UnwrappedLines instead of copying.
No functional change intended.
Modified:
cfe/trunk/lib/Format/UnwrappedLineParser.cpp
Modified: cfe/trunk/lib/Format/UnwrappedLineParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/UnwrappedLineParser.cpp?rev=238673&r1=238672&r2=238673&view=diff
==============================================================================
--- cfe/trunk/lib/Format/UnwrappedLineParser.cpp (original)
+++ cfe/trunk/lib/Format/UnwrappedLineParser.cpp Sun May 31 06:18:05 2015
@@ -1762,15 +1762,12 @@ void UnwrappedLineParser::addUnwrappedLi
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();
}
}
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic