From 0446152d15f0302ff004e3e7937c53cacbf5d94a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 15 Jul 2023 17:55:12 +0100 Subject: [PATCH] (Very) minor performance improvement. --- pcbnew/router/pns_kicad_iface.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 4c52d0208f..54516dab63 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -239,14 +239,18 @@ bool PNS_PCBNEW_RULE_RESOLVER::IsKeepout( const PNS::ITEM* aA, const PNS::ITEM* return false; }; - if( const ZONE* zoneA = dynamic_cast( aA->Parent() ) ) + if( aA->Parent() && aA->Parent()->Type() == PCB_ZONE_T ) { + const ZONE* zoneA = static_cast( aA->Parent() ); + if( zoneA->GetIsRuleArea() && aB->Parent() ) return checkKeepout( zoneA, aB->Parent() ); } - if( const ZONE* zoneB = dynamic_cast( aB->Parent() ) ) + if( aB->Parent() && aB->Parent()->Type() == PCB_ZONE_T ) { + const ZONE* zoneB = static_cast( aB->Parent() ); + if( zoneB->GetIsRuleArea() && aA->Parent() ) return checkKeepout( zoneB, aA->Parent() ); } @@ -915,14 +919,12 @@ public: SetView( aView ); } - ~PNS_PCBNEW_DEBUG_DECORATOR() { PNS_PCBNEW_DEBUG_DECORATOR::Clear(); delete m_items; } - void SetView( KIGFX::VIEW* aView ) { Clear(); @@ -941,7 +943,6 @@ public: m_view->Add( m_items ); } - void AddPoint( const VECTOR2I& aP, const KIGFX::COLOR4D& aColor, int aSize, const wxString& aName = wxT( "" ), const SRC_LOCATION_INFO& aSrcLoc = SRC_LOCATION_INFO() ) override @@ -960,7 +961,6 @@ public: AddShape( &sh, aColor, sh.Width(), aName, aSrcLoc ); } - void AddItem( const PNS::ITEM* aItem, const KIGFX::COLOR4D& aColor, int aOverrideWidth = 0, const wxString& aName = wxT( "" ), const SRC_LOCATION_INFO& aSrcLoc = SRC_LOCATION_INFO() ) override @@ -978,7 +978,6 @@ public: m_view->Update( m_items ); } - void AddShape( const BOX2I& aBox, const KIGFX::COLOR4D& aColor, int aOverrideWidth = 0, const wxString& aName = wxT( "" ), const SRC_LOCATION_INFO& aSrcLoc = SRC_LOCATION_INFO() ) override @@ -998,7 +997,6 @@ public: AddShape( &l, aColor, aOverrideWidth, aName, aSrcLoc ); } - void AddShape( const SHAPE* aShape, const KIGFX::COLOR4D& aColor, int aOverrideWidth = 0, const wxString& aName = wxT( "" ), const SRC_LOCATION_INFO& aSrcLoc = SRC_LOCATION_INFO() ) override @@ -1016,7 +1014,6 @@ public: m_view->Update( m_items ); } - void Clear() override { if( m_view && m_items ) @@ -1864,7 +1861,6 @@ void PNS_KICAD_IFACE::UpdateItem( PNS::ITEM* aItem ) void PNS_KICAD_IFACE_BASE::AddItem( PNS::ITEM* aItem ) { - }