Cleanup: Replace push_back with emplace_back

In cases where we create a new item and immediately push into a
container, the emplace idiom is faster and more efficient.
This commit is contained in:
Seth Hillbrand
2019-12-05 13:41:21 -08:00
parent 6f8b399c5f
commit b5f021ff9f
68 changed files with 294 additions and 294 deletions
+2 -2
View File
@@ -577,10 +577,10 @@ void PLOTTER::PlotPoly( const SHAPE_LINE_CHAIN& aCornerList, FILL_T aFill,
std::vector< wxPoint > cornerList;
for( int ii = 0; ii < aCornerList.PointCount(); ii++ )
cornerList.push_back( wxPoint( aCornerList.CPoint( ii ) ) );
cornerList.emplace_back( aCornerList.CPoint( ii ) );
if( aCornerList.IsClosed() && cornerList.front() != cornerList.back() )
cornerList.push_back( wxPoint( aCornerList.CPoint( 0 ) ) );
cornerList.emplace_back( aCornerList.CPoint( 0 ) );
PlotPoly( cornerList , aFill, aWidth, aData );
}