@@ -231,7 +231,7 @@ class WrappedLinesView {
231231 explicit WrappedLinesView ( const QString& longLine, LineLength visibleColumns )
232232 {
233233 if ( longLine.isEmpty () ) {
234- wrappedLines_.push_back ( WrappedString{} );
234+ wrappedLines_.emplace_back ( );
235235 }
236236 else {
237237#if QT_VERSION >= QT_VERSION_CHECK( 5, 10, 0 )
@@ -264,7 +264,7 @@ class WrappedLinesView {
264264 if ( wrappedLines_.size () == 1 ) {
265265 auto & wrappedLine = wrappedLines_.front ();
266266 auto len = std::min ( length.get (), getLength ( wrappedLine ) - start.get () );
267- resultChunks.push_back ( wrappedLine.mid ( start.get (), ( len > 0 ? len : 0 ) ) );
267+ resultChunks.emplace_back ( wrappedLine.mid ( start.get (), ( len > 0 ? len : 0 ) ) );
268268 return resultChunks;
269269 }
270270
@@ -281,7 +281,7 @@ class WrappedLinesView {
281281 auto chunkLength = length.get ();
282282 while ( positionInWrappedLine + chunkLength
283283 > getLength ( wrappedLines_[ wrappedLineIndex ] ) ) {
284- resultChunks.push_back (
284+ resultChunks.emplace_back (
285285 wrappedLines_[ wrappedLineIndex ].mid ( positionInWrappedLine ) );
286286 wrappedLineIndex++;
287287 positionInWrappedLine = 0 ;
@@ -294,7 +294,7 @@ class WrappedLinesView {
294294 if ( chunkLength > 0 ) {
295295 auto & wrappedLine = wrappedLines_[ wrappedLineIndex ];
296296 auto len = std::min ( chunkLength, getLength ( wrappedLine ) - positionInWrappedLine );
297- resultChunks.push_back (
297+ resultChunks.emplace_back (
298298 wrappedLine.mid ( positionInWrappedLine, ( len > 0 ? len : 0 ) ) );
299299 }
300300
@@ -2668,8 +2668,9 @@ void AbstractLogView::drawTextArea( QPaintDevice* paintDevice )
26682668 painter->drawText ( lineNumberAreaStartX + LineNumberPadding, yPos + fontAscent,
26692669 lineNumberStr );
26702670 }
2671+ wrappedLinesNumbers_.reserve (wrappedLineView.wrappedLinesCount ());
26712672 for ( auto i = 0u ; i < wrappedLineView.wrappedLinesCount (); ++i ) {
2672- wrappedLinesNumbers_.push_back ( std::make_pair ( lineNumber, i ) );
2673+ wrappedLinesNumbers_.emplace_back ( lineNumber, i );
26732674 }
26742675
26752676 yPos += finalLineHeight;
0 commit comments