performance efficiencies

This commit is contained in:
Jeff Young 2023-12-18 17:01:27 +00:00
parent 47e07f507e
commit 11805d6696
9 changed files with 19 additions and 19 deletions

View File

@ -170,7 +170,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
var.GetKey(), value);
std::string key( var.GetKey().ToUTF8() );
ret[key] = value;
ret[ std::move( key ) ] = value;
}
return ret;

View File

@ -587,7 +587,7 @@ template std::optional<wxAuiPaneInfo> JSON_SETTINGS::Get<wxAuiPaneInfo>( const s
template<typename ValueType>
void JSON_SETTINGS::Set( const std::string& aPath, ValueType aVal )
{
m_internals->SetFromString( aPath, aVal );
m_internals->SetFromString( aPath, std::move( aVal ) );
}
@ -797,7 +797,7 @@ bool JSON_SETTINGS::fromLegacyColor( wxConfigBase* aConfig, const std::string& a
try
{
nlohmann::json js = nlohmann::json::array( { color.r, color.g, color.b, color.a } );
( *m_internals )[aDest] = js;
( *m_internals )[aDest] = std::move( js );
}
catch( ... )
{

View File

@ -325,7 +325,7 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList )
DS_PROXY_UNDO_ITEM alt_item( this );
DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
item->Restore( this );
*item = alt_item;
*item = std::move( alt_item );
}
else if( SCH_ITEM* item = dynamic_cast<SCH_ITEM*>( eda_item ) )
{

View File

@ -38,8 +38,8 @@ public:
const VECTOR2I& aPt3 )> aTriangleCallback ) :
GAL( aDisplayOptions )
{
m_strokeCallback = aStrokeCallback;
m_triangleCallback = aTriangleCallback;
m_strokeCallback = std::move( aStrokeCallback );
m_triangleCallback = std::move( aTriangleCallback );
m_outlineCallback = []( const SHAPE_LINE_CHAIN& ) {};
m_stroke = true;
m_triangulate = true;
@ -51,9 +51,9 @@ public:
std::function<void( const SHAPE_LINE_CHAIN& aPoly )> aOutlineCallback ) :
GAL( aDisplayOptions )
{
m_strokeCallback = aStrokeCallback;
m_strokeCallback = std::move( aStrokeCallback );
m_triangleCallback = []( const VECTOR2I&, const VECTOR2I&, const VECTOR2I& ) {};
m_outlineCallback = aOutlineCallback;
m_outlineCallback = std::move( aOutlineCallback;
m_stroke = true;
m_triangulate = false;
}
@ -64,7 +64,7 @@ public:
{
m_strokeCallback = []( const VECTOR2I& aPt1, const VECTOR2I& aPt2 ) {};
m_triangleCallback = []( const VECTOR2I&, const VECTOR2I&, const VECTOR2I& ) {};
m_outlineCallback = aOutlineCallback;
m_outlineCallback = std::move( aOutlineCallback );
m_stroke = false;
m_triangulate = false;
}

View File

@ -31,9 +31,9 @@ class FONTINFO
{
public:
FONTINFO( std::string aFile, std::string aStyle, std::string aFamily ) :
m_file( aFile ),
m_style( aStyle ),
m_family( aFamily )
m_file( std::move( aFile ) ),
m_style( std::move( aStyle ) ),
m_family( std::move( aFamily ) )
{
}

View File

@ -236,7 +236,7 @@ struct VIEWPORT3D
VIEWPORT3D( const wxString& aName, glm::mat4 aViewMatrix ) :
name( aName ),
matrix( aViewMatrix )
matrix( std::move( aViewMatrix ) )
{ }
wxString name;

View File

@ -285,9 +285,9 @@ public:
std::function<void( ValueType )> aSetter, ValueType aDefault,
bool aReadOnly = false ) :
PARAM_BASE( aJsonPath, aReadOnly ),
m_default( aDefault ),
m_getter( aGetter ),
m_setter( aSetter )
m_default( std::move( aDefault ) ),
m_getter( std::move( aGetter ) ),
m_setter( std::move( aSetter ) )
{ }
void Load( JSON_SETTINGS* aSettings, bool aResetIfMissing = true ) const override;
@ -426,7 +426,7 @@ public:
std::vector<Type> aDefault, bool aReadOnly = false ) :
PARAM_BASE( aJsonPath, aReadOnly ),
m_ptr( aPtr ),
m_default( aDefault )
m_default( std::move( aDefault ) )
{ }
void Load( JSON_SETTINGS* aSettings, bool aResetIfMissing = true ) const override;

View File

@ -833,7 +833,7 @@ void SHAPE_POLY_SET::booleanOp( ClipperLib::ClipType aType, const SHAPE_POLY_SET
//@todo amend X,Y values to true intersection between arcs or arc and segment
};
c.ZFillFunction( callback ); // register callback
c.ZFillFunction( std::move( callback ) ); // register callback
c.Execute( aType, solution, ClipperLib::pftNonZero, ClipperLib::pftNonZero );

View File

@ -376,7 +376,7 @@ bool FOOTPRINT_EDITOR_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
{ "", true, F_Fab }
} );
Set( "design_settings.default_footprint_text_items", textItems );
Set( "design_settings.default_footprint_text_items", std::move( textItems ) );
ret &= fromLegacyString( aCfg, "FpEditorRefDefaultText", "design_settings.default_footprint_text_items.0.0" );
ret &= fromLegacy<bool>( aCfg, "FpEditorRefDefaultVisibility", "design_settings.default_footprint_text_items.0.1" );