Deprecate TableVal::Lookup(), replace with Find()/FindOrDefault()

This commit is contained in:
Jon Siwek 2020-05-20 18:00:50 -07:00
parent b85cfc6fe4
commit 85a0ddd62d
17 changed files with 105 additions and 63 deletions

View file

@ -2669,7 +2669,7 @@ IntrusivePtr<Val> IndexExpr::Fold(Val* v1, Val* v2) const
break;
case TYPE_TABLE:
v = v1->AsTableVal()->Lookup(v2); // Then, we jump into the TableVal here.
v = v1->AsTableVal()->FindOrDefault({NewRef{}, v2}); // Then, we jump into the TableVal here.
break;
case TYPE_STRING:
@ -3995,7 +3995,7 @@ IntrusivePtr<Val> InExpr::Fold(Val* v1, Val* v2) const
if ( is_vector(v2) )
res = (bool)v2->AsVectorVal()->Lookup(v1);
else
res = (bool)v2->AsTableVal()->Lookup(v1, false);
res = (bool)v2->AsTableVal()->Find({NewRef{}, v1});
return val_mgr->Bool(res);
}