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

@ -13,10 +13,9 @@
#include <vector>
#include <map>
CompositeHash::CompositeHash(TypeList* composite_type)
CompositeHash::CompositeHash(IntrusivePtr<TypeList> composite_type)
:type(std::move(composite_type))
{
type = composite_type;
Ref(type);
singleton_tag = TYPE_INTERNAL_ERROR;
// If the only element is a record, don't treat it as a
@ -66,7 +65,6 @@ CompositeHash::CompositeHash(TypeList* composite_type)
CompositeHash::~CompositeHash()
{
Unref(type);
delete [] key;
}