From 76a3b3db971136977519cf86df9d34b48db80c5e Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 28 Aug 2023 17:03:39 -0700 Subject: [PATCH] Better handle many (MANY) duplicate refs In large designs with thousands of duplicate elements (e.g. power symbols), we need to be smart about vector management. Removing all but the first few items should be batched and not element at a time Ref: KSC-885 (cherry picked from commit b43f037a91407c96b76358a7204acf67a02706c4) --- eeschema/sch_reference_list.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eeschema/sch_reference_list.cpp b/eeschema/sch_reference_list.cpp index 70c50f332f..3a63f63b94 100644 --- a/eeschema/sch_reference_list.cpp +++ b/eeschema/sch_reference_list.cpp @@ -652,8 +652,7 @@ void SCH_REFERENCE_LIST::Annotate( bool aUseSheetNum, int aSheetIntervalId, int } // Remove aAdditionalRefs references - for( size_t i = originalSize; i < ( aAdditionalRefs.GetCount() + originalSize ); i++ ) - RemoveItem( originalSize ); + m_flatList.erase( m_flatList.begin() + originalSize, m_flatList.end() ); wxASSERT( originalSize == GetCount() ); // Make sure we didn't make a mistake }