Fix optimization to not fetch all possible endpoints for non-connectable.

This commit is contained in:
Jeff Young 2021-09-24 20:08:42 +01:00
parent fad385785d
commit 7901d705ba
2 changed files with 38 additions and 30 deletions

View File

@ -589,6 +589,8 @@ void SCH_LINE::GetEndPoints( std::vector <DANGLING_END_ITEM>& aItemList )
bool SCH_LINE::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList, bool SCH_LINE::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
const SCH_SHEET_PATH* aPath ) const SCH_SHEET_PATH* aPath )
{
if( IsConnectable() )
{ {
bool previousStartState = m_startIsDangling; bool previousStartState = m_startIsDangling;
bool previousEndState = m_endIsDangling; bool previousEndState = m_endIsDangling;
@ -618,10 +620,13 @@ bool SCH_LINE::UpdateDanglingState( std::vector<DANGLING_END_ITEM>& aItemList,
// has changed or not (and returning true will result in extra work) // has changed or not (and returning true will result in extra work)
if( IsBus() ) if( IsBus() )
return false; return false;
else
return previousStartState != m_startIsDangling || previousEndState != m_endIsDangling; return previousStartState != m_startIsDangling || previousEndState != m_endIsDangling;
} }
return false;
}
bool SCH_LINE::IsConnectable() const bool SCH_LINE::IsConnectable() const
{ {

View File

@ -981,6 +981,8 @@ void SCH_SCREEN::TestDanglingEnds( const SCH_SHEET_PATH* aPath,
std::vector<DANGLING_END_ITEM> endPoints; std::vector<DANGLING_END_ITEM> endPoints;
for( SCH_ITEM* item : Items() ) for( SCH_ITEM* item : Items() )
{
if( item->IsConnectable() )
{ {
endPoints.clear(); endPoints.clear();
@ -994,6 +996,7 @@ void SCH_SCREEN::TestDanglingEnds( const SCH_SHEET_PATH* aPath,
} }
} }
} }
}
SCH_LINE* SCH_SCREEN::GetLine( const wxPoint& aPosition, int aAccuracy, int aLayer, SCH_LINE* SCH_SCREEN::GetLine( const wxPoint& aPosition, int aAccuracy, int aLayer,