mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
HashKey: Do not call Describe() unconditionally in DEBUG mode
An unnecessary overhead of the Hash() method was uncovered for DEBUG builds due to computing a description of every HashKey() even when the DBG_HASHKEY stream is not enabled. Squelch it.
This commit is contained in:
parent
252cd33283
commit
92e73606ba
1 changed files with 6 additions and 3 deletions
|
@ -213,9 +213,12 @@ hash_t HashKey::Hash() const
|
|||
if ( hash == 0 )
|
||||
hash = HashBytes(key, size);
|
||||
#ifdef DEBUG
|
||||
if ( zeek::detail::debug_logger.IsEnabled(DBG_HASHKEY) )
|
||||
{
|
||||
ODesc d;
|
||||
Describe(&d);
|
||||
DBG_LOG(DBG_HASHKEY, "HashKey %p %s", this, d.Description());
|
||||
}
|
||||
#endif
|
||||
return hash;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue