From: Peter van Dijk Date: Fri, 24 Mar 2017 10:42:09 +0000 (+0100) Subject: don't move return value X-Git-Tag: rec-4.1.0-alpha1~171^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c735407e945ce5ef820e3f857bf93343e764b4e2;p=thirdparty%2Fpdns.git don't move return value luawrapper 6a6c672 --- diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index 0cf1a434fd..eb0ec598f4 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -557,7 +557,7 @@ public: result.threadInRegistry = std::unique_ptr(new ValueInRegistry(mState)); lua_pop(mState, 1); - return std::move(result); + return result; } /** @@ -699,7 +699,7 @@ private: PushedObject& operator=(PushedObject&& other) { std::swap(state, other.state); std::swap(num, other.num); return *this; } PushedObject(PushedObject&& other) : state(other.state), num(other.num) { other.num = 0; } - PushedObject operator+(PushedObject&& other) && { PushedObject obj(state, num + other.num); num = 0; other.num = 0; return std::move(obj); } + PushedObject operator+(PushedObject&& other) && { PushedObject obj(state, num + other.num); num = 0; other.num = 0; return obj; } void operator+=(PushedObject&& other) { assert(state == other.state); num += other.num; other.num = 0; } auto getState() const -> lua_State* { return state; } @@ -1541,7 +1541,7 @@ private: lua_setmetatable(state, -2); pushedTable.release(); - return std::move(obj); + return obj; } }; @@ -1997,7 +1997,7 @@ struct LuaContext::Pusher> { for (auto i = value.begin(), e = value.end(); i != e; ++i) setTable(state, obj, i->first, i->second); - return std::move(obj); + return obj; } }; @@ -2016,7 +2016,7 @@ struct LuaContext::Pusher> { for (auto i = value.begin(), e = value.end(); i != e; ++i) setTable(state, obj, i->first, i->second); - return std::move(obj); + return obj; } }; @@ -2035,7 +2035,7 @@ struct LuaContext::Pusher>> { for (auto i = value.begin(), e = value.end(); i != e; ++i) setTable(state, obj, i->first, i->second); - return std::move(obj); + return obj; } }; @@ -2053,7 +2053,7 @@ struct LuaContext::Pusher> { for (unsigned int i = 0; i < value.size(); ++i) setTable(state, obj, i + 1, value[i]); - return std::move(obj); + return obj; } }; @@ -2341,7 +2341,7 @@ struct LuaContext::Pusher> PushedObject obj{state, 0}; VariantWriter writer{state, obj}; value.apply_visitor(writer); - return std::move(obj); + return obj; } private: