]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - ext/luawrapper/include/LuaContext.hpp
LuaWrapper: Don't move the content of vectors, maps and unordered_maps
[thirdparty/pdns.git] / ext / luawrapper / include / LuaContext.hpp
index 9416c906c3539cce6e7b04172d8b56418f957a35..d0ffe6f6bee867776188a32c93447aae9118e04c 100644 (file)
@@ -2607,7 +2607,7 @@ struct LuaContext::Reader<std::vector<std::pair<TType1,TType2>>>
                     return {};
                 }
 
-                result.push_back({ std::move(val1.get()), std::move(val2.get()) });
+                result.push_back({ val1.get(), val2.get() });
                 lua_pop(state, 1);      // we remove the value but keep the key for the next iteration
 
             } catch(...) {
@@ -2645,7 +2645,7 @@ struct LuaContext::Reader<std::map<TKey,TValue>>
                     return {};
                 }
 
-                result.insert({ std::move(key.get()), std::move(value.get()) });
+                result.insert({ key.get(), value.get() });
                 lua_pop(state, 1);      // we remove the value but keep the key for the next iteration
 
             } catch(...) {
@@ -2683,7 +2683,7 @@ struct LuaContext::Reader<std::unordered_map<TKey,TValue>>
                     return {};
                 }
 
-                result.insert({ std::move(key.get()), std::move(value.get()) });
+                result.insert({ key.get(), value.get() });
                 lua_pop(state, 1);      // we remove the value but keep the key for the next iteration
 
             } catch(...) {