Skip to content

Commit

Permalink
session manager in memory, addressing TODO.
Browse files Browse the repository at this point in the history
does not seem to bring down performance.
  • Loading branch information
devnexen committed Dec 7, 2023
1 parent b7c737f commit 774faa6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/lib/tls/tls_session_manager_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,9 @@ std::vector<Session_with_Handle> Session_Manager_In_Memory::find_some(const Serv
lock_guard_type<recursive_mutex_type> lk(mutex());

std::vector<Session_with_Handle> 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;
}
Expand Down

0 comments on commit 774faa6

Please sign in to comment.