CompHash: use class IntrusivePtr for the type field

This commit is contained in:
Max Kellermann 2020-02-18 12:13:33 +01:00
parent 31b3a56740
commit 53f49e0057
7 changed files with 17 additions and 22 deletions

View file

@ -27,10 +27,9 @@ void TopkVal::Typify(BroType* t)
{
assert(!hash && !type);
type = t->Ref();
TypeList* tl = new TypeList(t);
auto tl = make_intrusive<TypeList>(t);
tl->Append(t->Ref());
hash = new CompositeHash(tl);
Unref(tl);
hash = new CompositeHash(std::move(tl));
}
HashKey* TopkVal::GetHash(Val* v) const