From c826ed68b5dbace1b2bf31be9dfb5ffb397d24ed Mon Sep 17 00:00:00 2001 From: Otto Date: Mon, 6 Dec 2021 15:40:19 +0100 Subject: [PATCH] Use move for inserting string into pool --- pdns/lua-recursor4.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index 94bb9bcebd..4fa6b16e2a 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -1042,15 +1042,11 @@ public: handle(h) { } - ~pdns_postresolve_ffi_handle() - { - cerr << "~pdns_postresolve_ffi_handle: " << pool.size() << endl; - } RecursorLua4::PostResolveFFIHandle& handle; std::unordered_set pool; - auto insert(const std::string& str) + auto insert(std::string&& str) { - auto [it, inserted] = pool.insert(str); + auto [it, inserted] = pool.insert(std::move(str)); return it; } }; -- 2.47.2