Browse Source

Avoid copying tool parameter in intermediate function call

newinvert
Ian McInerney 2 years ago
parent
commit
236de6679c
  1. 4
      common/tool/tool_manager.cpp
  2. 4
      include/tool/tool_manager.h

4
common/tool/tool_manager.cpp

@ -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 )

4
include/tool/tool_manager.h

@ -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 std::string& aActionName, 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, 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.

Loading…
Cancel
Save