Deprecate Frame::NthElement(), replace with GetElement()

This commit is contained in:
Jon Siwek 2020-05-23 08:52:34 -07:00
parent e9e2e388f8
commit 1ccbe743d0
2 changed files with 5 additions and 1 deletions

View file

@ -42,6 +42,10 @@ public:
* @param n the index to get.
* @return the value at index *n* of the underlying array.
*/
const IntrusivePtr<Val>& GetElement(int n) const
{ return frame[n]; }
[[deprecated("Remove in v4.1. Use GetElement(int).")]]
Val* NthElement(int n) const { return frame[n].get(); }
/**

View file

@ -367,7 +367,7 @@ IntrusivePtr<Val> BroFunc::operator()(zeek::Args* args, Frame* parent) const
{
const auto& arg = (*args)[j];
if ( f->NthElement(j) != arg )
if ( f->GetElement(j) != arg )
// Either not yet set, or somebody reassigned the frame slot.
f->SetElement(j, arg);
}