Make DRAWSEGMENT::GetRectCorners return vector
... instead of modifying the argument. This will make the method usable in python API and will not incur permormance penalty because named return value optimization (NRVO) is a thing since C++11. But even if copy is not elided vector is moved instead of copied. https://en.cppreference.com/w/cpp/language/copy_elision
This commit is contained in:
@@ -506,8 +506,7 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( EDGE_MODULE* aEdge )
|
||||
|
||||
case S_RECT:
|
||||
{
|
||||
std::vector<wxPoint> pts;
|
||||
aEdge->GetRectCorners( &pts );
|
||||
std::vector<wxPoint> pts = aEdge->GetRectCorners();
|
||||
|
||||
if( aEdge->GetWidth() > 0 )
|
||||
{
|
||||
@@ -868,8 +867,7 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg )
|
||||
|
||||
case S_RECT:
|
||||
{
|
||||
std::vector<wxPoint> pts;
|
||||
aSeg->GetRectCorners( &pts );
|
||||
std::vector<wxPoint> pts = aSeg->GetRectCorners();
|
||||
|
||||
if( aSeg->GetWidth() > 0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user