From 1e7b9c2863bdf69496bb65a4aaa2b579173e79c5 Mon Sep 17 00:00:00 2001 From: Otto Date: Tue, 7 Dec 2021 08:51:26 +0100 Subject: [PATCH] Move pool to private and return const iterator --- pdns/lua-recursor4.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.47.2