diff --git a/components/lua/scriptscontainer.cpp b/components/lua/scriptscontainer.cpp index 3d7287d3a8..1a37970ad8 100644 --- a/components/lua/scriptscontainer.cpp +++ b/components/lua/scriptscontainer.cpp @@ -532,7 +532,7 @@ namespace LuaUtil t.mScriptId = scriptId; t.mSerializable = true; t.mTime = time; - t.mArg = callbackArg; + t.mArg = std::move(callbackArg); t.mSerializedArg = serialize(t.mArg, mSerializer); insertTimer(type == TimerType::GAME_TIME ? mGameTimersQueue : mSimulationTimersQueue, std::move(t)); } diff --git a/components/lua_ui/properties.hpp b/components/lua_ui/properties.hpp index 3ef2ddc31b..81fb272f17 100644 --- a/components/lua_ui/properties.hpp +++ b/components/lua_ui/properties.hpp @@ -25,7 +25,7 @@ namespace LuaUi } template - sol::optional parseValue(sol::object table, std::string_view field, std::string_view errorPrefix) + sol::optional parseValue(const sol::object& table, std::string_view field, std::string_view errorPrefix) { sol::object opt = LuaUtil::getFieldOrNil(table, field); if (opt != sol::nil && !opt.is()) @@ -51,7 +51,7 @@ namespace LuaUi } template - sol::optional parseValue(sol::object table, std::string_view field, std::string_view errorPrefix) + sol::optional parseValue(const sol::object& table, std::string_view field, std::string_view errorPrefix) { if constexpr (isMyGuiVector()) return parseValue(table, field, errorPrefix); diff --git a/components/lua_ui/scriptsettings.cpp b/components/lua_ui/scriptsettings.cpp index ba0328d710..e92d1d8958 100644 --- a/components/lua_ui/scriptsettings.cpp +++ b/components/lua_ui/scriptsettings.cpp @@ -21,7 +21,7 @@ namespace LuaUi Log(Debug::Warning) << "A script settings page has an empty name"; if (!element.get()) Log(Debug::Warning) << "A script settings page has no UI element assigned"; - return { name, searchHints, element }; + return { std::move(name), std::move(searchHints), element }; } } diff --git a/components/lua_ui/widget.cpp b/components/lua_ui/widget.cpp index ae859341e4..ff9f4d90a2 100644 --- a/components/lua_ui/widget.cpp +++ b/components/lua_ui/widget.cpp @@ -266,7 +266,7 @@ namespace LuaUi mOnCoordChange.value()(this, newCoord); } - void WidgetExtension::setProperties(sol::object props) + void WidgetExtension::setProperties(const sol::object& props) { mProperties = props; updateProperties(); diff --git a/components/lua_ui/widget.hpp b/components/lua_ui/widget.hpp index b1c67ae3fa..3dbc14b6c3 100644 --- a/components/lua_ui/widget.hpp +++ b/components/lua_ui/widget.hpp @@ -44,10 +44,10 @@ namespace LuaUi void setCallback(const std::string&, const LuaUtil::Callback&); void clearCallbacks(); - void setProperties(sol::object); - void setTemplateProperties(sol::object props) { mTemplateProperties = props; } + void setProperties(const sol::object& props); + void setTemplateProperties(const sol::object& props) { mTemplateProperties = props; } - void setExternal(sol::object external) { mExternal = external; } + void setExternal(const sol::object& external) { mExternal = external; } MyGUI::IntCoord forcedCoord(); void forceCoord(const MyGUI::IntCoord& offset);