mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Deprecate TableVal::FindAttr(), replace with GetAttr()
This commit is contained in:
parent
e365105872
commit
ce6f69cd19
2 changed files with 11 additions and 5 deletions
|
@ -1813,7 +1813,7 @@ bool TableVal::ExpandAndInit(IntrusivePtr<Val> index, IntrusivePtr<Val> new_val)
|
||||||
|
|
||||||
IntrusivePtr<Val> TableVal::Default(const IntrusivePtr<Val>& index)
|
IntrusivePtr<Val> TableVal::Default(const IntrusivePtr<Val>& index)
|
||||||
{
|
{
|
||||||
Attr* def_attr = FindAttr(ATTR_DEFAULT);
|
const auto& def_attr = GetAttr(ATTR_DEFAULT);
|
||||||
|
|
||||||
if ( ! def_attr )
|
if ( ! def_attr )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -2199,9 +2199,9 @@ ListVal* TableVal::ConvertToPureList() const
|
||||||
return ToPureListVal().release();
|
return ToPureListVal().release();
|
||||||
}
|
}
|
||||||
|
|
||||||
Attr* TableVal::FindAttr(attr_tag t) const
|
const IntrusivePtr<Attr>& TableVal::GetAttr(attr_tag t) const
|
||||||
{
|
{
|
||||||
return attrs ? attrs->Find(t).get() : nullptr;
|
return attrs ? attrs->Find(t) : Attr::nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TableVal::Describe(ODesc* d) const
|
void TableVal::Describe(ODesc* d) const
|
||||||
|
@ -2340,7 +2340,8 @@ void TableVal::InitDefaultFunc(Frame* f)
|
||||||
if ( def_val )
|
if ( def_val )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Attr* def_attr = FindAttr(ATTR_DEFAULT);
|
const auto& def_attr = GetAttr(ATTR_DEFAULT);
|
||||||
|
|
||||||
if ( ! def_attr )
|
if ( ! def_attr )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -930,7 +930,12 @@ public:
|
||||||
ListVal* ConvertToPureList() const; // must be single index type
|
ListVal* ConvertToPureList() const; // must be single index type
|
||||||
|
|
||||||
void SetAttrs(IntrusivePtr<Attributes> attrs);
|
void SetAttrs(IntrusivePtr<Attributes> attrs);
|
||||||
Attr* FindAttr(attr_tag t) const;
|
|
||||||
|
[[deprecated("Remove in v4.1. Use GetAttr().")]]
|
||||||
|
Attr* FindAttr(attr_tag t) const
|
||||||
|
{ return GetAttr(t).get(); }
|
||||||
|
|
||||||
|
const IntrusivePtr<Attr>& GetAttr(attr_tag t) const;
|
||||||
|
|
||||||
[[deprecated("Remove in v4.1. Use GetAttrs().")]]
|
[[deprecated("Remove in v4.1. Use GetAttrs().")]]
|
||||||
Attributes* Attrs() { return attrs.get(); }
|
Attributes* Attrs() { return attrs.get(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue