diff --git a/src/lib/tls/tls_session_manager_memory.cpp b/src/lib/tls/tls_session_manager_memory.cpp index 7d1543a2181..a4c073c9f4e 100644 --- a/src/lib/tls/tls_session_manager_memory.cpp +++ b/src/lib/tls/tls_session_manager_memory.cpp @@ -67,12 +67,9 @@ 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::ranges::copy_if(m_sessions | std::views::values, std::back_inserter(found_sessions), [&](const auto& e) { + return e.session.server_info() == info; + }); return found_sessions; }