From d878cbddbc02f1fc3cfa30bea4c802aba20c3869 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 7 Apr 2021 23:34:45 -0400 Subject: [PATCH] PNS: a few forgotten cleanup items --- pcbnew/router/pns_node.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 3f86b71abf..995cb3b8a1 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -904,7 +904,7 @@ void NODE::followLine( LINKED_ITEM* aCurrent, bool aScanDirection, int& aPos, in aCurrent = jt->NextSegment( aCurrent ); - prevReversed = ( jt->Pos() == aCurrent->Anchor( aScanDirection ) ); + prevReversed = ( aCurrent && jt->Pos() == aCurrent->Anchor( aScanDirection ) ); } } @@ -921,7 +921,8 @@ const LINE NODE::AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex, LINE pl; bool guardHit = false; - int i_start = MaxVerts / 2, i_end = i_start + 1; + int i_start = MaxVerts / 2; + int i_end = i_start + 1; pl.SetWidth( aSeg->Width() ); pl.SetLayers( aSeg->Layers() ); @@ -933,8 +934,8 @@ const LINE NODE::AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex, if( !guardHit ) { - followLine( aSeg, true, i_end, MaxVerts, corners.data(), segs.data(), arcReversed.data(), guardHit, - aStopAtLockedJoints ); + followLine( aSeg, true, i_end, MaxVerts, corners.data(), segs.data(), arcReversed.data(), + guardHit, aStopAtLockedJoints ); } int n = 0; @@ -947,8 +948,6 @@ const LINE NODE::AssembleLine( LINKED_ITEM* aSeg, int* aOriginSegmentIndex, const VECTOR2I& p = corners[i]; LINKED_ITEM* li = segs[i]; - int nsegs = pl.Line().SegmentCount(); - if( !li || li->Kind() != ITEM::ARC_T ) pl.Line().Append( p ); @@ -1345,12 +1344,12 @@ void NODE::ClearRanks( int aMarkerMask ) void NODE::RemoveByMarker( int aMarker ) { - std::list garbage; + std::vector garbage; for( ITEM* item : *m_index ) { if( item->Marker() & aMarker ) - garbage.push_back( item ); + garbage.emplace_back( item ); } for( ITEM* item : garbage )