calculator: avoid copy of cable names

This commit is contained in:
Fabien Corona 2024-10-17 12:08:11 +02:00
parent b342126ff3
commit 4c57d748ab
2 changed files with 5 additions and 6 deletions

View File

@ -32,9 +32,8 @@ extern double DoubleFromString( const wxString& TextValue );
// The default current density in ampere by mm2 (3A/mm2 is common to make transformers) // The default current density in ampere by mm2 (3A/mm2 is common to make transformers)
#define AMP_DENSITY_BY_MM2 3.0 #define AMP_DENSITY_BY_MM2 3.0
CABLE_SIZE_ENTRY::CABLE_SIZE_ENTRY( wxString aName, double aRadius_meter ) : CABLE_SIZE_ENTRY::CABLE_SIZE_ENTRY( const wxString& aName, double aRadius_meter ) :
m_Name( aName ), m_Name( aName ), m_Radius( aRadius_meter )
m_Radius( aRadius_meter )
{ {
} }

View File

@ -31,10 +31,10 @@ class PCB_CALCULATOR_SETTINGS;
class CABLE_SIZE_ENTRY class CABLE_SIZE_ENTRY
{ {
public: public:
CABLE_SIZE_ENTRY( wxString aName, double aRadius_meter ); CABLE_SIZE_ENTRY( const wxString& aName, double aRadius_meter );
wxString m_Name; const wxString m_Name;
double m_Radius; // stored in meters const double m_Radius; // stored in meters
}; };
class PANEL_CABLE_SIZE : public PANEL_CABLE_SIZE_BASE class PANEL_CABLE_SIZE : public PANEL_CABLE_SIZE_BASE