Skip to content

Commit 5318107

Browse files
committed
++ cache
1 parent 40cc76f commit 5318107

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

storage/cache.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,9 @@ int NHTFlowCache::put_pkt(Packet& packet)
528528
auto [row, flow_identification] =
529529
find_flow_index(direct_key, reversed_key, packet.vlan_id);
530530

531-
if (const size_t* hash_value = std::get_if<size_t>(&flow_identification)) {
532-
//const size_t hash_value = std::visit([](const size_t hash_value){ return hash_value;},flow_identification);
533-
const size_t empty_place = get_empty_place(row, packet.ts) + (*hash_value & m_line_mask);
534-
create_record(packet, empty_place, *hash_value);
531+
if (const size_t hash_value = std::holds_alternative<size_t>(flow_identification)) {
532+
const size_t empty_place = get_empty_place(row, packet.ts) + (hash_value & m_line_mask);
533+
create_record(packet, empty_place, hash_value);
535534
export_expired(packet.ts);
536535
return 0;
537536
}

0 commit comments

Comments
 (0)