Move SetLayerSet to const reference

Avoids potential performance inefficiencies
This commit is contained in:
Seth Hillbrand 2024-08-17 07:55:32 -07:00
parent 54a34b2e7d
commit b6c1a3ba63
6 changed files with 6 additions and 6 deletions

View File

@ -250,7 +250,7 @@ public:
return LSET( m_layer ); return LSET( m_layer );
} }
virtual void SetLayerSet( LSET aLayers ) virtual void SetLayerSet( const LSET& aLayers )
{ {
if( aLayers.count() == 1 ) if( aLayers.count() == 1 )
{ {

View File

@ -384,7 +384,7 @@ public:
m_polyDirty[ERROR_OUTSIDE] = true; m_polyDirty[ERROR_OUTSIDE] = true;
} }
void SetLayerSet( LSET aLayers ) override { m_padStack.SetLayerSet( aLayers ); } void SetLayerSet( const LSET& aLayers ) override { m_padStack.SetLayerSet( aLayers ); }
LSET GetLayerSet() const override { return m_padStack.LayerSet(); } LSET GetLayerSet() const override { return m_padStack.LayerSet(); }
void SetAttribute( PAD_ATTRIB aAttribute ); void SetAttribute( PAD_ATTRIB aAttribute );

View File

@ -917,7 +917,7 @@ LSET PCB_VIA::GetLayerSet() const
} }
void PCB_VIA::SetLayerSet( LSET aLayerSet ) void PCB_VIA::SetLayerSet( const LSET& aLayerSet )
{ {
bool first = true; bool first = true;

View File

@ -418,7 +418,7 @@ public:
* Note SetLayerSet() initialize the first and last copper layers connected by the via. * Note SetLayerSet() initialize the first and last copper layers connected by the via.
* So currently SetLayerSet ignore non copper layers * So currently SetLayerSet ignore non copper layers
*/ */
virtual void SetLayerSet( LSET aLayers ) override; virtual void SetLayerSet( const LSET& aLayers ) override;
/** /**
* For a via m_layer contains the top layer, the other layer is in m_bottomLayer/ * For a via m_layer contains the top layer, the other layer is in m_bottomLayer/

View File

@ -282,7 +282,7 @@ void ZONE::SetLayer( PCB_LAYER_ID aLayer )
} }
void ZONE::SetLayerSet( LSET aLayerSet ) void ZONE::SetLayerSet( const LSET& aLayerSet )
{ {
if( aLayerSet.count() == 0 ) if( aLayerSet.count() == 0 )
return; return;

View File

@ -126,7 +126,7 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override; void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
wxString GetFriendlyName() const override; wxString GetFriendlyName() const override;
void SetLayerSet( LSET aLayerSet ) override; void SetLayerSet( const LSET& aLayerSet ) override;
virtual LSET GetLayerSet() const override { return m_layerSet; } virtual LSET GetLayerSet() const override { return m_layerSet; }
const wxString& GetZoneName() const { return m_zoneName; } const wxString& GetZoneName() const { return m_zoneName; }