@@ -220,7 +220,7 @@ NHTFlowCache::find_row(const std::variant<FlowKeyv4, FlowKeyv6>& key, const std:
220220 const size_t first_flow_in_row = hash_value & m_line_mask;
221221 const CacheRowSpan row (&m_flow_table[first_flow_in_row], m_line_size);
222222 if (const std::optional<size_t > flow_index = row.find_by_hash (hash_value, vlan_id); flow_index.has_value ()) {
223- return {row, first_flow_in_row + flow_index. value () , hash_value};
223+ return {row, first_flow_in_row + * flow_index, hash_value};
224224 }
225225 return {row, std::nullopt , hash_value};
226226}
@@ -232,15 +232,15 @@ NHTFlowCache::find_flow_index(const std::variant<FlowKeyv4, FlowKeyv6>& key,
232232
233233 const auto [direct_row, direct_flow_index, direct_hash_value] = find_row (key, vlan_id);
234234 if (direct_flow_index.has_value ()) {
235- return {direct_row, std::make_pair (direct_flow_index. value () , true )};
235+ return {direct_row, std::make_pair (* direct_flow_index, true )};
236236 }
237237 if (m_split_biflow) {
238238 return {direct_row, direct_hash_value};
239239 }
240240
241241 const auto [reversed_row, reversed_flow_index, reversed_hash_value] = find_row (key_reversed, vlan_id);
242242 if (reversed_flow_index.has_value ()) {
243- return {reversed_row, std::make_pair (reversed_flow_index. value () , false )};
243+ return {reversed_row, std::make_pair (* reversed_flow_index, false )};
244244 }
245245
246246 return {direct_row, direct_hash_value};
@@ -528,10 +528,10 @@ 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 (std::holds_alternative <size_t >(flow_identification)) {
532- const size_t hash_value = std::get< size_t >( 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::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);
535535 export_expired (packet.ts );
536536 return 0 ;
537537 }
0 commit comments