Switch ListVal to store IntrusivePtrs

* Deprecates ListVal::Index() methods and replaces with ListVal::Idx()

* Replaces ListVal::Vals() method with one that returns
  std::vector<IntrusivePtr<Val>> rather than val_list
This commit is contained in:
Jon Siwek 2020-05-05 14:13:14 -07:00
parent b422f68b88
commit 5f57ceb70a
19 changed files with 111 additions and 100 deletions

View file

@ -45,7 +45,7 @@ void* PrefixTable::Insert(const Val* value, void* data)
// [elem] -> elem
if ( value->Type()->Tag() == TYPE_LIST &&
value->AsListVal()->Length() == 1 )
value = value->AsListVal()->Index(0);
value = value->AsListVal()->Idx(0).get();
switch ( value->Type()->Tag() ) {
case TYPE_ADDR:
@ -105,7 +105,7 @@ void* PrefixTable::Lookup(const Val* value, bool exact) const
// [elem] -> elem
if ( value->Type()->Tag() == TYPE_LIST &&
value->AsListVal()->Length() == 1 )
value = value->AsListVal()->Index(0);
value = value->AsListVal()->Idx(0).get();
switch ( value->Type()->Tag() ) {
case TYPE_ADDR:
@ -144,7 +144,7 @@ void* PrefixTable::Remove(const Val* value)
// [elem] -> elem
if ( value->Type()->Tag() == TYPE_LIST &&
value->AsListVal()->Length() == 1 )
value = value->AsListVal()->Index(0);
value = value->AsListVal()->Idx(0).get();
switch ( value->Type()->Tag() ) {
case TYPE_ADDR: