Performance optimizations.

This commit is contained in:
Jeff Young 2025-06-06 10:35:03 +01:00
parent aa892efc17
commit 31c6c28882
4 changed files with 15 additions and 17 deletions

View File

@ -590,8 +590,6 @@ wxString EscapeHTML( const wxString& aString )
wxString UnescapeHTML( const wxString& aString ) wxString UnescapeHTML( const wxString& aString )
{ {
wxString converted = aString;
// clang-format off // clang-format off
static const std::map<wxString, wxString> c_replacements = { static const std::map<wxString, wxString> c_replacements = {
{ wxS( "quot" ), wxS( "\"" ) }, { wxS( "quot" ), wxS( "\"" ) },
@ -617,7 +615,7 @@ wxString UnescapeHTML( const wxString& aString )
size_t len = 0; size_t len = 0;
wxString result; wxString result;
wxString str = converted; wxString str = aString;
while( regex.Matches( str ) ) while( regex.Matches( str ) )
{ {

View File

@ -730,9 +730,9 @@ void KIBIS_PIN::getKuKdFromFile( const std::string& aSimul )
Report( _( "Cannot remove temporary output file" ), RPT_SEVERITY_WARNING ); Report( _( "Cannot remove temporary output file" ), RPT_SEVERITY_WARNING );
} }
m_Ku = ku; m_Ku = std::move( ku );
m_Kd = kd; m_Kd = std::move( kd );
m_t = t; m_t = std::move( t );
} }
@ -831,9 +831,9 @@ void KIBIS_PIN::getKuKdOneWaveform( KIBIS_MODEL&
ku.push_back( 0 ); ku.push_back( 0 );
kd.push_back( 0 ); kd.push_back( 0 );
t.push_back( 0 ); t.push_back( 0 );
m_Ku = ku; m_Ku = std::move( ku );
m_Kd = kd; m_Kd = std::move( kd );
m_t = t; m_t = std::move( t );
} }
else else
{ {
@ -978,9 +978,9 @@ void KIBIS_PIN::getKuKdNoWaveform( KIBIS_MODEL& aModel, const KIBIS_PARAMETER& a
t.push_back( 0 ); t.push_back( 0 );
} }
m_Ku = ku; m_Ku = std::move( ku );
m_Kd = kd; m_Kd = std::move( kd );
m_t = t; m_t = std::move( t );
} }
@ -1003,9 +1003,9 @@ void KIBIS_PIN::getKuKdTwoWaveforms( KIBIS_MODEL&
ku.push_back( 0 ); ku.push_back( 0 );
kd.push_back( 0 ); kd.push_back( 0 );
t.push_back( 0 ); t.push_back( 0 );
m_Ku = ku; m_Ku = std::move( ku );
m_Kd = kd; m_Kd = std::move( kd );
m_t = t; m_t = std::move( t );
} }
else else
{ {

View File

@ -1999,7 +1999,7 @@ bool SHAPE_POLY_SET::Parse( std::stringstream& aStream )
paths.push_back( std::move( outline ) ); paths.push_back( std::move( outline ) );
} }
m_polys.push_back( paths ); m_polys.push_back( std::move( paths ) );
} }
return true; return true;

View File

@ -257,7 +257,7 @@ bool WALKAROUND::singleStep()
if ( anyColliding ) if ( anyColliding )
{ {
shortest = shortest_alt; shortest = std::move( shortest_alt );
} }
if( !shortest ) if( !shortest )