From 3b683ba6d4de6baded9521d59438ade71ac20019 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 24 Mar 2022 17:13:09 +0100 Subject: [PATCH] reserving memory in advance --- src/nodes/QskArcRenderer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/nodes/QskArcRenderer.cpp b/src/nodes/QskArcRenderer.cpp index 5cc21283..0f89d7d6 100644 --- a/src/nodes/QskArcRenderer.cpp +++ b/src/nodes/QskArcRenderer.cpp @@ -17,12 +17,10 @@ void QskArcRenderer::renderArc(const QRectF& rect, painter->setRenderHint( QPainter::Antialiasing, true ); QGradientStops stops; + stops.reserve( gradient.stops().count() ); for( const QskGradientStop& stop : qAsConst( gradient.stops() ) ) - { - QGradientStop s( stop.position(), stop.color() ); - stops.append( s ); - } + stops += QGradientStop( stop.position(), stop.color() ); /* horizontal is interpreted as in direction of the arc,