Update TestDanglingEnds to O(n) speed

The elements don't care which they connect to, so don't search for
points on the page, just collect them all and then test them all

Adjusts f3dd5b73
This commit is contained in:
Seth Hillbrand
2023-08-31 15:31:48 +00:00
parent 0aaafc92fc
commit c2fd2f42eb
3 changed files with 37 additions and 26 deletions
+3 -7
View File
@@ -305,12 +305,6 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
schItem->ClearEditFlags();
}
if( frame )
{
frame->RecalculateConnections( this, NO_CLEANUP );
frame->TestDanglingEnds();
}
if( schematic )
{
if( bulkAddedItems.size() > 0 )
@@ -326,7 +320,10 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
if( !( aCommitFlags & SKIP_UNDO ) )
{
if( frame )
{
frame->SaveCopyInUndoList( undoList, UNDO_REDO::UNSPECIFIED, false, dirtyConnectivity );
frame->RecalculateConnections( this, NO_CLEANUP );
}
}
m_toolMgr->PostEvent( { TC_MESSAGE, TA_MODEL_CHANGE, AS_GLOBAL } );
@@ -528,7 +525,6 @@ void SCH_COMMIT::Revert()
if( frame )
{
frame->RecalculateConnections( nullptr, NO_CLEANUP );
frame->TestDanglingEnds();
}
clear();