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
@@ -574,7 +574,8 @@ void PLOTTER::ThickCircle( const wxPoint& pos, int diametre, int width,
void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
int aWidth, void * aData )
{
std::vector< wxPoint > cornerList;
std::vector<wxPoint> cornerList;
cornerList.reserve( aCornerList.PointCount() );
for( int ii = 0; ii < aCornerList.PointCount(); ii++ )
cornerList.emplace_back( aCornerList.CPoint( ii ) );
@@ -582,7 +583,7 @@ void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
if( aCornerList.IsClosed() && cornerList.front() != cornerList.back() )
cornerList.emplace_back( aCornerList.CPoint( 0 ) );
PlotPoly( cornerList , aFill, aWidth, aData );
PlotPoly( cornerList, aFill, aWidth, aData );
}