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 Nov 30, 2023
1 parent 3005ae6 commit a1270b5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 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,10 @@ 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);
}
}
auto t = m_sessions | std::views::values;
std::copy_if(t.begin(), t.end(), std::back_inserter(found_sessions), [&](const auto& e) {
return e.session.server_info() == info;
});

return found_sessions;
}
Expand Down

0 comments on commit a1270b5

Please sign in to comment.