diff --git a/src/Val.cc b/src/Val.cc index a20e00570d..33c2cb2b0a 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -3972,11 +3972,10 @@ const PortValPtr& ValManager::Port(uint32_t port_num, TransportProto port_type) port_num = 0; } - std::pair key{port_num, port_type}; - if ( ports.find(key) == ports.end() ) - ports[key] = IntrusivePtr{AdoptRef{}, new PortVal(PortVal::Mask(port_num, port_type))}; + if ( ports.find(port_num) == ports.end() ) + ports[port_num] = IntrusivePtr{AdoptRef{}, new PortVal(PortVal::Mask(port_num, port_type))}; - return ports[key]; + return ports[port_num]; } const PortValPtr& ValManager::Port(uint32_t port_num) diff --git a/src/Val.h b/src/Val.h index 60e1aa73dd..8cd0da05a2 100644 --- a/src/Val.h +++ b/src/Val.h @@ -339,7 +339,7 @@ public: const PortValPtr& Port(uint32_t port_num); private: - std::map, PortValPtr> ports; + std::unordered_map ports; std::array counts; std::array ints; StringValPtr empty_string;