From 96491132cecdd5c0ee00f5371236bcab980cf027 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 5 Apr 2025 12:14:50 +0100 Subject: [PATCH] Performance. --- pcbnew/board.cpp | 19 ------------------- pcbnew/board.h | 11 ----------- pcbnew/tools/pcb_selection_tool.cpp | 4 ++-- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 5274955387..b694c57730 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -2243,25 +2243,6 @@ PAD* BOARD::GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const } -PAD* BOARD::GetPadFast( const VECTOR2I& aPosition, const LSET& aLayerSet ) const -{ - for( FOOTPRINT* footprint : Footprints() ) - { - for( PAD* pad : footprint->Pads() ) - { - if( pad->GetPosition() != aPosition ) - continue; - - // Pad found, it must be on the correct layer - if( ( pad->GetLayerSet() & aLayerSet ).any() ) - return pad; - } - } - - return nullptr; -} - - PAD* BOARD::GetPad( std::vector& aPadList, const VECTOR2I& aPosition, const LSET& aLayerSet ) const { // Search aPadList for aPosition diff --git a/pcbnew/board.h b/pcbnew/board.h index 4a9b589ee1..c472529ef9 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -1125,17 +1125,6 @@ public: */ PAD* GetPad( const PCB_TRACK* aTrace, ENDPOINT_T aEndPoint ) const; - /** - * Return pad found at \a aPosition on \a aLayerMask using the fast search method. - *

- * The fast search method only works if the pad list has already been built. - *

- * @param aPosition A VECTOR2I object containing the position to hit test. - * @param aLayerMask A layer or layers to mask the hit test. - * @return A pointer to a PAD object if found or NULL if not found. - */ - PAD* GetPadFast( const VECTOR2I& aPosition, const LSET& aLayerMask ) const; - /** * Locate the pad connected at \a aPosition on \a aLayer starting at list position * \a aPad diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 12e6f6bcfb..dfbdf7f1a2 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2817,7 +2817,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili const PCB_DISPLAY_OPTIONS& options = frame()->GetDisplayOptions(); auto visibleLayers = - [&]() + [&]() -> LSET { if( m_isFootprintEditor ) { @@ -3906,7 +3906,7 @@ void PCB_SELECTION_TOOL::FilterCollectorForFootprints( GENERAL_COLLECTOR& aColle } auto visibleLayers = - [&]() + [&]() -> LSET { if( m_isFootprintEditor ) {