From cf6b6020a013f279a42bc4e63bbb1d6393e4adec Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 23 Feb 2024 17:03:13 +0400 Subject: [PATCH] Move local variables --- apps/openmw/mwlua/nearbybindings.cpp | 4 ++-- components/lua/asyncpackage.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwlua/nearbybindings.cpp b/apps/openmw/mwlua/nearbybindings.cpp index 7eda965e96..af6980fb7f 100644 --- a/apps/openmw/mwlua/nearbybindings.cpp +++ b/apps/openmw/mwlua/nearbybindings.cpp @@ -163,8 +163,8 @@ namespace MWLua ignore = parseIgnoreList(*options); } - context.mLuaManager->addAction([context, ignore, callback = LuaUtil::Callback::fromLua(callback), from, - to] { + context.mLuaManager->addAction([context, ignore = std::move(ignore), + callback = LuaUtil::Callback::fromLua(callback), from, to] { MWPhysics::RayCastingResult res; MWBase::Environment::get().getWorld()->castRenderingRay(res, from, to, false, false, ignore); context.mLuaManager->queueCallback(callback, sol::main_object(context.mLua->sol(), sol::in_place, res)); diff --git a/components/lua/asyncpackage.cpp b/components/lua/asyncpackage.cpp index 6e13406511..5d563e6276 100644 --- a/components/lua/asyncpackage.cpp +++ b/components/lua/asyncpackage.cpp @@ -94,7 +94,7 @@ namespace LuaUtil sol::table callbackMeta = Callback::makeMetatable(L); api["callback"] = [callbackMeta](const AsyncPackageId& asyncId, sol::main_protected_function fn) -> sol::table { - return Callback::make(asyncId, fn, callbackMeta); + return Callback::make(asyncId, std::move(fn), callbackMeta); }; auto initializer = [](sol::table hiddenData) {