From: Otto Date: Mon, 6 Dec 2021 14:40:19 +0000 (+0100) Subject: Use move for inserting string into pool X-Git-Tag: auth-4.7.0-alpha1~111^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c826ed68b5dbace1b2bf31be9dfb5ffb397d24ed;p=thirdparty%2Fpdns.git Use move for inserting string into pool --- 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; } };