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:
qu1ck
2020-09-07 05:33:10 +00:00
committed by Seth Hillbrand
parent 758a4c26d5
commit 636285311e
7 changed files with 21 additions and 29 deletions
+2 -4
View File
@@ -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 )
{