diff --git a/src/lib/tls/tls_session_manager_memory.cpp b/src/lib/tls/tls_session_manager_memory.cpp index 7d1543a2181..2a3d3474100 100644 --- a/src/lib/tls/tls_session_manager_memory.cpp +++ b/src/lib/tls/tls_session_manager_memory.cpp @@ -67,12 +67,10 @@ std::vector Session_Manager_In_Memory::find_some(const Serv lock_guard_type lk(mutex()); std::vector found_sessions; - // TODO: std::copy_if? - for(const auto& [_, session_and_handle] : m_sessions) { - if(session_and_handle.session.server_info() == info) { - found_sessions.emplace_back(session_and_handle); - } - } + std::vector tmp; + std::ranges::transform(m_sessions, std::back_inserter(tmp), [](const auto& e) { return e.second; }); + std::ranges::copy_if( + tmp, std::back_inserter(found_sessions), [&](const auto& e) { return e.session.server_info() == info; }); return found_sessions; }