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

@ -590,6 +590,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,8 +620,11 @@ 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;
} }

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();
@ -993,6 +995,7 @@ void SCH_SCREEN::TestDanglingEnds( const SCH_SHEET_PATH* aPath,
(*aChangedHandler)( item ); (*aChangedHandler)( item );
} }
} }
}
} }