Deprecate VectorVal::Lookup(), replace with At()

This commit is contained in:
Jon Siwek 2020-05-21 17:03:46 -07:00
parent 69533bcbc6
commit a384bb8b81
16 changed files with 74 additions and 69 deletions

View file

@ -266,7 +266,7 @@ char* CompositeHash::SingleValHash(bool type_check, char* kp0,
kp1 = reinterpret_cast<char*>(kp+1);
for ( unsigned int i = 0; i < vv->Size(); ++i )
{
Val* val = vv->Lookup(i);
const auto& val = vv->At(i);
unsigned int* kp = AlignAndPadType<unsigned int>(kp1);
*kp = i;
kp1 = reinterpret_cast<char*>(kp+1);
@ -277,7 +277,8 @@ char* CompositeHash::SingleValHash(bool type_check, char* kp0,
if ( val )
{
if ( ! (kp1 = SingleValHash(type_check, kp1,
vt->Yield().get(), val, false)) )
vt->Yield().get(), val.get(),
false)) )
return nullptr;
}
}
@ -564,12 +565,12 @@ int CompositeHash::SingleTypeKeySize(BroType* bt, const Val* v,
VectorVal* vv = const_cast<VectorVal*>(v->AsVectorVal());
for ( unsigned int i = 0; i < vv->Size(); ++i )
{
Val* val = vv->Lookup(i);
const auto& val = vv->At(i);
sz = SizeAlign(sz, sizeof(unsigned int));
sz = SizeAlign(sz, sizeof(unsigned int));
if ( val )
sz = SingleTypeKeySize(bt->AsVectorType()->Yield().get(),
val, type_check, sz, false,
val.get(), type_check, sz, false,
calc_static_size);
if ( ! sz ) return 0;
}