Use unordered_map to store sessions for performance reasons

This commit is contained in:
Tim Wojtulewicz 2021-07-28 14:04:34 -07:00
parent 2a717e05cc
commit e2dc6df8a2
4 changed files with 36 additions and 4 deletions

View file

@ -70,4 +70,14 @@ bool Key::operator<(const Key& rhs) const
return memcmp(data, rhs.data, size) < 0;
}
bool Key::operator==(const Key& rhs) const
{
if ( size != rhs.size )
return false;
else if ( type != rhs.type )
return false;
return memcmp(data, rhs.data, size) == 0;
}
} // namespace zeek::session::detail