Made two functions immune to empty containers.
This commit is contained in:
parent
487b609e76
commit
386d1fc257
|
@ -70,7 +70,10 @@ public:
|
||||||
|
|
||||||
void MIN_SPAN_TREE_PADS::AddTreeToRatsnest( std::vector<RATSNEST_ITEM> &aRatsnestList )
|
void MIN_SPAN_TREE_PADS::AddTreeToRatsnest( std::vector<RATSNEST_ITEM> &aRatsnestList )
|
||||||
{
|
{
|
||||||
std::vector<D_PAD*> & padsBuffer = *m_PadsList;
|
std::vector<D_PAD*>& padsBuffer = *m_PadsList;
|
||||||
|
if( padsBuffer.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
int netcode = padsBuffer[0]->GetNet();
|
int netcode = padsBuffer[0]->GetNet();
|
||||||
// Note: to get edges in minimum spanning tree,
|
// Note: to get edges in minimum spanning tree,
|
||||||
// the index value 0 is not used: it is just
|
// the index value 0 is not used: it is just
|
||||||
|
|
|
@ -240,7 +240,7 @@ void RN_NET::compute()
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if( boardNodes.size() == 1 ) // This case is even simpler
|
else if( boardNodes.size() == 1 || boardNodes.empty() ) // This case is even simpler
|
||||||
{
|
{
|
||||||
m_rnEdges.reset( new std::vector<RN_EDGE_PTR>( 0 ) );
|
m_rnEdges.reset( new std::vector<RN_EDGE_PTR>( 0 ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue