From: Otto Date: Tue, 7 Dec 2021 07:51:26 +0000 (+0100) Subject: Move pool to private and return const iterator X-Git-Tag: auth-4.7.0-alpha1~111^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e7b9c2863bdf69496bb65a4aaa2b579173e79c5;p=thirdparty%2Fpdns.git Move pool to private and return const iterator --- diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index e009963016..4b04fe7a5b 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -1043,12 +1043,13 @@ public: { } RecursorLua4::PostResolveFFIHandle& handle; - std::unordered_set pool; auto insert(std::string&& str) { - auto [it, inserted] = pool.insert(std::move(str)); + const auto it = pool.insert(std::move(str)).first; return it; } +private: + std::unordered_set pool; }; bool RecursorLua4::postresolve_ffi(RecursorLua4::PostResolveFFIHandle& h) const