@@ -231,7 +231,7 @@ class WrappedLinesView {
231
231
explicit WrappedLinesView ( const QString& longLine, LineLength visibleColumns )
232
232
{
233
233
if ( longLine.isEmpty () ) {
234
- wrappedLines_.push_back ( WrappedString{} );
234
+ wrappedLines_.emplace_back ( );
235
235
}
236
236
else {
237
237
#if QT_VERSION >= QT_VERSION_CHECK( 5, 10, 0 )
@@ -264,7 +264,7 @@ class WrappedLinesView {
264
264
if ( wrappedLines_.size () == 1 ) {
265
265
auto & wrappedLine = wrappedLines_.front ();
266
266
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 ) ) );
268
268
return resultChunks;
269
269
}
270
270
@@ -281,7 +281,7 @@ class WrappedLinesView {
281
281
auto chunkLength = length.get ();
282
282
while ( positionInWrappedLine + chunkLength
283
283
> getLength ( wrappedLines_[ wrappedLineIndex ] ) ) {
284
- resultChunks.push_back (
284
+ resultChunks.emplace_back (
285
285
wrappedLines_[ wrappedLineIndex ].mid ( positionInWrappedLine ) );
286
286
wrappedLineIndex++;
287
287
positionInWrappedLine = 0 ;
@@ -294,7 +294,7 @@ class WrappedLinesView {
294
294
if ( chunkLength > 0 ) {
295
295
auto & wrappedLine = wrappedLines_[ wrappedLineIndex ];
296
296
auto len = std::min ( chunkLength, getLength ( wrappedLine ) - positionInWrappedLine );
297
- resultChunks.push_back (
297
+ resultChunks.emplace_back (
298
298
wrappedLine.mid ( positionInWrappedLine, ( len > 0 ? len : 0 ) ) );
299
299
}
300
300
@@ -2668,8 +2668,9 @@ void AbstractLogView::drawTextArea( QPaintDevice* paintDevice )
2668
2668
painter->drawText ( lineNumberAreaStartX + LineNumberPadding, yPos + fontAscent,
2669
2669
lineNumberStr );
2670
2670
}
2671
+ wrappedLinesNumbers_.reserve (wrappedLineView.wrappedLinesCount ());
2671
2672
for ( auto i = 0u ; i < wrappedLineView.wrappedLinesCount (); ++i ) {
2672
- wrappedLinesNumbers_.push_back ( std::make_pair ( lineNumber, i ) );
2673
+ wrappedLinesNumbers_.emplace_back ( lineNumber, i );
2673
2674
}
2674
2675
2675
2676
yPos += finalLineHeight;
0 commit comments