mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
TableVal: Replace raw subnets/pattern_matcher with unique_ptr
This commit is contained in:
parent
36c43d2aa3
commit
cf9afd7b77
2 changed files with 6 additions and 9 deletions
|
@ -1563,12 +1563,10 @@ void TableVal::Init(TableTypePtr t, bool ordered) {
|
|||
def_val = nullptr;
|
||||
|
||||
if ( table_type->IsSubNetIndex() )
|
||||
subnets = new detail::PrefixTable;
|
||||
else
|
||||
subnets = nullptr;
|
||||
subnets = std::make_unique<detail::PrefixTable>();
|
||||
|
||||
if ( table_type->IsPatternIndex() )
|
||||
pattern_matcher = new detail::TablePatternMatcher(this, table_type->Yield());
|
||||
pattern_matcher = std::make_unique<detail::TablePatternMatcher>(this, table_type->Yield());
|
||||
|
||||
table_hash = new detail::CompositeHash(table_type->GetIndices());
|
||||
if ( ordered )
|
||||
|
@ -1585,8 +1583,6 @@ TableVal::~TableVal() {
|
|||
|
||||
delete table_hash;
|
||||
delete table_val;
|
||||
delete subnets;
|
||||
delete pattern_matcher;
|
||||
delete expire_iterator;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue