mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Changed implementation from std::map to std::unordered_map of Val.cc
This commit is contained in:
parent
d7474e2aa2
commit
9a3855cc38
2 changed files with 4 additions and 5 deletions
|
@ -3972,11 +3972,10 @@ const PortValPtr& ValManager::Port(uint32_t port_num, TransportProto port_type)
|
||||||
port_num = 0;
|
port_num = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair key{port_num, port_type};
|
if ( ports.find(port_num) == ports.end() )
|
||||||
if ( ports.find(key) == ports.end() )
|
ports[port_num] = IntrusivePtr{AdoptRef{}, new PortVal(PortVal::Mask(port_num, port_type))};
|
||||||
ports[key] = 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)
|
const PortValPtr& ValManager::Port(uint32_t port_num)
|
||||||
|
|
|
@ -339,7 +339,7 @@ public:
|
||||||
const PortValPtr& Port(uint32_t port_num);
|
const PortValPtr& Port(uint32_t port_num);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<std::pair<uint32_t, TransportProto>, PortValPtr> ports;
|
std::unordered_map<uint32_t, PortValPtr> ports;
|
||||||
std::array<ValPtr, PREALLOCATED_COUNTS> counts;
|
std::array<ValPtr, PREALLOCATED_COUNTS> counts;
|
||||||
std::array<ValPtr, PREALLOCATED_INTS> ints;
|
std::array<ValPtr, PREALLOCATED_INTS> ints;
|
||||||
StringValPtr empty_string;
|
StringValPtr empty_string;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue