From 1ccbe743d016642f90d6c25549a7a109e4f8f53f Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Sat, 23 May 2020 08:52:34 -0700 Subject: [PATCH] Deprecate Frame::NthElement(), replace with GetElement() --- src/Frame.h | 4 ++++ src/Func.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Frame.h b/src/Frame.h index 57827f1b5b..1003be2ce5 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -42,6 +42,10 @@ public: * @param n the index to get. * @return the value at index *n* of the underlying array. */ + const IntrusivePtr& GetElement(int n) const + { return frame[n]; } + + [[deprecated("Remove in v4.1. Use GetElement(int).")]] Val* NthElement(int n) const { return frame[n].get(); } /** diff --git a/src/Func.cc b/src/Func.cc index 8553d9234f..b35736db92 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -367,7 +367,7 @@ IntrusivePtr 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); }