mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Improve TableVal HashKey management
* Deprecated ComputeHash() methods and replaced with MakeHashKey() which returns std::unique_ptr<HashKey> * Deprecated RecoverIndex() and replaced with RecreateIndex() which takes HashKey& and returns IntrusivePtr. * Updated the new TableVal Assign()/Remove() methods to take either std::unique_ptr<HashKey> or HashKey& as appropriate for clarity of ownership expectations.
This commit is contained in:
parent
8a6a92c348
commit
3f92df51b7
18 changed files with 137 additions and 114 deletions
|
@ -166,12 +166,12 @@ HashKey* AnalyzerSet::GetKey(const file_analysis::Tag& t, RecordVal* args) const
|
|||
auto lv = make_intrusive<ListVal>(TYPE_ANY);
|
||||
lv->Append(t.AsVal());
|
||||
lv->Append({NewRef{}, args});
|
||||
HashKey* key = analyzer_hash->ComputeHash(*lv, true);
|
||||
auto key = analyzer_hash->MakeHashKey(*lv, true);
|
||||
|
||||
if ( ! key )
|
||||
reporter->InternalError("AnalyzerArgs type mismatch");
|
||||
|
||||
return key;
|
||||
return key.release();
|
||||
}
|
||||
|
||||
file_analysis::Analyzer* AnalyzerSet::InstantiateAnalyzer(const Tag& tag,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue