Changes in response to Johanna's code review.

This commit is contained in:
Seth Hall 2020-10-15 12:42:48 -04:00
parent 2f05318a08
commit 56e234a762
3 changed files with 18 additions and 6 deletions

View file

@ -1991,9 +1991,15 @@ ValPtr TableVal::FindOrDefault(const ValPtr& index)
return Default(index);
}
bool TableVal::Contains(const IPAddr& addr)
const bool TableVal::Contains(const IPAddr& addr)
{
return subnets ? subnets->Lookup(addr, true) != 0 : false;
if ( ! subnets )
{
reporter->InternalError("LookupSubnets called on wrong table type");
return false;
}
return (subnets->Lookup(addr, true) != 0);
}
Val* TableVal::Lookup(Val* index, bool use_default_val)