mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Avoid O(n) search in EnumType::Lookup
This commit is contained in:
parent
28fd2a7a7a
commit
c22e54604f
2 changed files with 14 additions and 21 deletions
|
@ -863,8 +863,8 @@ protected:
|
|||
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
using NameMap = std::map<std::string, zeek_int_t>;
|
||||
NameMap names;
|
||||
std::map<std::string, zeek_int_t> names;
|
||||
std::map<zeek_int_t, std::string> rev_names;
|
||||
|
||||
// Whether any of the elements of the enum were added via redef's.
|
||||
bool has_redefs = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue