From f5b372429bd7acee6b198e715ca7cbe76aa5688d Mon Sep 17 00:00:00 2001 From: Damir Zainullin Date: Tue, 7 Jan 2025 01:38:41 +0100 Subject: [PATCH] ++ cache --- storage/cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/cache.cpp b/storage/cache.cpp index 0092fcc9..c528a0dc 100644 --- a/storage/cache.cpp +++ b/storage/cache.cpp @@ -291,7 +291,7 @@ void NHTFlowCache::create_record(const Packet& packet, size_t flow_index, size_t m_ctt_hash_collision++; std::vector filtered; - std::copy_if(m_flow_table, m_flow_table + m_cache_size, std::back_inserter(filtered), + std::copy_if(m_flow_table.begin(), m_flow_table.end(), std::back_inserter(filtered), [&](FlowRecord* flow) { return flow->m_flow.flow_hash_ctt == m_flow_table[flow_index]->m_flow.flow_hash_ctt; }); filtered.size(); } @@ -315,7 +315,7 @@ void NHTFlowCache::try_to_add_flow_to_ctt(size_t flow_index) noexcept m_ctt_hash_collision++; std::vector filtered; - std::copy_if(m_flow_table, m_flow_table + m_cache_size, std::back_inserter(filtered), + std::copy_if(m_flow_table.begin(), m_flow_table.end(), std::back_inserter(filtered), [&](FlowRecord* flow) { return flow->m_flow.flow_hash_ctt == m_flow_table[flow_index]->m_flow.flow_hash_ctt; }); filtered.size(); }