Deprecate SetType::SetElements(), replace with SetType::Elements()

This commit is contained in:
Jon Siwek 2020-05-06 17:56:23 -07:00
parent 0f59b80d66
commit 9ab7150883
2 changed files with 6 additions and 2 deletions

View file

@ -429,8 +429,12 @@ public:
IntrusivePtr<BroType> ShallowClone() override; IntrusivePtr<BroType> ShallowClone() override;
[[deprecated("Remove in v4.1. Use Elements() isntead.")]]
ListExpr* SetElements() const { return elements.get(); } ListExpr* SetElements() const { return elements.get(); }
const IntrusivePtr<ListExpr>& Elements() const
{ return elements; }
protected: protected:
IntrusivePtr<ListExpr> elements; IntrusivePtr<ListExpr> elements;
}; };

View file

@ -162,7 +162,7 @@ static void make_var(ID* id, IntrusivePtr<BroType> t, init_class c,
if ( t && t->IsSet() ) if ( t && t->IsSet() )
{ // Check for set with explicit elements. { // Check for set with explicit elements.
SetType* st = t->AsTableType()->AsSetType(); SetType* st = t->AsTableType()->AsSetType();
ListExpr* elements = st->SetElements(); const auto& elements = st->Elements();
if ( elements ) if ( elements )
{ {
@ -172,7 +172,7 @@ static void make_var(ID* id, IntrusivePtr<BroType> t, init_class c,
return; return;
} }
init = {NewRef{}, elements}; init = elements;
} }
} }