Performance improvements.

Don't construct a wxString or a LSEQ when you don't
have to.  They're both more expensive than you might
think.
This commit is contained in:
Jeff Young
2024-06-12 11:06:10 +01:00
parent 63cd110720
commit 694a7db457
13 changed files with 181 additions and 132 deletions
+9 -4
View File
@@ -528,12 +528,17 @@ bool collidesWithArea( BOARD_ITEM* aItem, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
if( zoneRTree )
{
for( PCB_LAYER_ID layer : aArea->GetLayerSet().Seq() )
for( size_t ii = 0; ii < aArea->GetLayerSet().size(); ++ii )
{
if( aCtx->GetLayer() == layer || aCtx->GetLayer() == UNDEFINED_LAYER )
if( aArea->GetLayerSet().test( ii ) )
{
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, layer ) )
return true;
PCB_LAYER_ID layer = PCB_LAYER_ID( ii );
if( aCtx->GetLayer() == layer || aCtx->GetLayer() == UNDEFINED_LAYER )
{
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, layer ) )
return true;
}
}
}
}