Deprecate Attributes::FindAttr(), replace with Find()

This commit is contained in:
Jon Siwek 2020-05-26 15:25:08 -07:00
parent 6daa33364b
commit bee321711f
10 changed files with 46 additions and 33 deletions

View file

@ -183,7 +183,7 @@ char* CompositeHash::SingleValHash(bool type_check, char* kp0,
auto rv_i = rv->GetField(i).get();
Attributes* a = rt->FieldDecl(i)->attrs.get();
bool optional = (a && a->FindAttr(ATTR_OPTIONAL));
bool optional = (a && a->Find(ATTR_OPTIONAL));
if ( ! (rv_i || optional) )
return nullptr;
@ -514,7 +514,7 @@ int CompositeHash::SingleTypeKeySize(BroType* bt, const Val* v,
for ( int i = 0; i < num_fields; ++i )
{
Attributes* a = rt->FieldDecl(i)->attrs.get();
bool optional = (a && a->FindAttr(ATTR_OPTIONAL));
bool optional = (a && a->Find(ATTR_OPTIONAL));
sz = SingleTypeKeySize(rt->GetFieldType(i).get(),
rv ? rv->GetField(i).get() : nullptr,
@ -906,7 +906,7 @@ const char* CompositeHash::RecoverOneVal(const HashKey& k, const char* kp0,
IntrusivePtr<Val> v;
Attributes* a = rt->FieldDecl(i)->attrs.get();
bool optional = (a && a->FindAttr(ATTR_OPTIONAL));
bool optional = (a && a->Find(ATTR_OPTIONAL));
kp = RecoverOneVal(k, kp, k_end,
rt->GetFieldType(i).get(), &v, optional);