Avoid copying tool parameter in intermediate function call

This commit is contained in:
Ian McInerney 2023-07-02 22:18:24 +01:00
parent 5e740c354e
commit 236de6679c
2 changed files with 4 additions and 4 deletions

View File

@ -285,7 +285,7 @@ bool TOOL_MANAGER::InvokeTool( const std::string& aToolName )
} }
bool TOOL_MANAGER::doRunAction( const std::string& aActionName, bool aNow, std::any aParam, bool TOOL_MANAGER::doRunAction( const std::string& aActionName, bool aNow, const std::any& aParam,
COMMIT* aCommit ) COMMIT* aCommit )
{ {
TOOL_ACTION* action = m_actionMgr->FindAction( aActionName ); TOOL_ACTION* action = m_actionMgr->FindAction( aActionName );
@ -320,7 +320,7 @@ VECTOR2D TOOL_MANAGER::GetCursorPosition() const
} }
bool TOOL_MANAGER::doRunAction( const TOOL_ACTION& aAction, bool aNow, std::any aParam, bool TOOL_MANAGER::doRunAction( const TOOL_ACTION& aAction, bool aNow, const std::any& aParam,
COMMIT* aCommit ) COMMIT* aCommit )
{ {
if( m_shuttingDown ) if( m_shuttingDown )

View File

@ -545,8 +545,8 @@ private:
/** /**
* Helper function to actually run an action. * Helper function to actually run an action.
*/ */
bool doRunAction( const TOOL_ACTION& aAction, bool aNow, std::any aParam, COMMIT* aCommit ); bool doRunAction( const TOOL_ACTION& aAction, bool aNow, const std::any& aParam, COMMIT* aCommit );
bool doRunAction( const std::string& aActionName, bool aNow, std::any aParam, COMMIT* aCommit ); bool doRunAction( const std::string& aActionName, bool aNow, const std::any& aParam, COMMIT* aCommit );
/** /**
* Pass an event at first to the active tools, then to all others. * Pass an event at first to the active tools, then to all others.