mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
TablePatternMatcher: Drop Insert()/Remove(), use Clear()
Also move Clear() when assigning into more generic Assign() function.
This commit is contained in:
parent
e68194f2df
commit
36c43d2aa3
1 changed files with 4 additions and 7 deletions
11
src/Val.cc
11
src/Val.cc
|
@ -1436,9 +1436,6 @@ public:
|
|||
vtype = make_intrusive<VectorType>(std::move(_yield));
|
||||
}
|
||||
|
||||
void Insert(ValPtr pat, ValPtr yield) { Clear(); }
|
||||
void Remove(ValPtr pat) { Clear(); }
|
||||
|
||||
void Clear() { matcher.reset(); }
|
||||
|
||||
VectorValPtr Lookup(const StringValPtr& s);
|
||||
|
@ -1687,9 +1684,6 @@ bool TableVal::Assign(ValPtr index, ValPtr new_val, bool broker_forward, bool* i
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( pattern_matcher )
|
||||
pattern_matcher->Insert(index, new_val);
|
||||
|
||||
return Assign(std::move(index), std::move(k), std::move(new_val), broker_forward, iterators_invalidated);
|
||||
}
|
||||
|
||||
|
@ -1718,6 +1712,9 @@ bool TableVal::Assign(ValPtr index, std::unique_ptr<detail::HashKey> k, ValPtr n
|
|||
subnets->Insert(index.get(), new_entry_val);
|
||||
}
|
||||
|
||||
if ( pattern_matcher )
|
||||
pattern_matcher->Clear();
|
||||
|
||||
// Keep old expiration time if necessary.
|
||||
if ( old_entry_val && attrs && attrs->Find(detail::ATTR_EXPIRE_CREATE) )
|
||||
new_entry_val->SetExpireAccess(old_entry_val->ExpireAccessTime());
|
||||
|
@ -2252,7 +2249,7 @@ ValPtr TableVal::Remove(const Val& index, bool broker_forward, bool* iterators_i
|
|||
reporter->InternalWarning("index not in prefix table");
|
||||
|
||||
if ( pattern_matcher )
|
||||
pattern_matcher->Remove(index.AsListVal()->Idx(0));
|
||||
pattern_matcher->Clear();
|
||||
|
||||
delete v;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue