Minor speed cleanup

This adjusts iterators to use const reference when only used for
copy.  It also ensures pre-allocation of vectors when size is known
ahead of time.
This commit is contained in:
Seth Hillbrand
2019-12-05 14:20:59 -08:00
parent b5f021ff9f
commit c6f5df134c
39 changed files with 89 additions and 85 deletions
+3 -2
View File
@@ -645,8 +645,9 @@ void HPGL_PLOTTER::FlashPadRoundRect( const wxPoint& aPadPos, const wxSize& aSiz
aCornerRadius, 0.0, 0, GetPlotterArcHighDef() );
// TransformRoundRectToPolygon creates only one convex polygon
std::vector< wxPoint > cornerList;
SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
std::vector<wxPoint> cornerList;
SHAPE_LINE_CHAIN& poly = outline.Outline( 0 );
cornerList.reserve( poly.PointCount() );
for( int ii = 0; ii < poly.PointCount(); ++ii )
cornerList.emplace_back( poly.Point( ii ).x, poly.Point( ii ).y );