mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Deprecate Frame::GetElement(ID*), replace with GetElementByID()
This commit is contained in:
parent
1ccbe743d0
commit
9f4eca081f
3 changed files with 13 additions and 6 deletions
|
@ -121,12 +121,12 @@ void Frame::SetElement(const ID* id, IntrusivePtr<Val> v)
|
|||
SetElement(id->Offset(), std::move(v));
|
||||
}
|
||||
|
||||
Val* Frame::GetElement(const ID* id) const
|
||||
const IntrusivePtr<Val>& Frame::GetElementByID(const ID* id) const
|
||||
{
|
||||
if ( closure )
|
||||
{
|
||||
if ( IsOuterID(id) )
|
||||
return closure->GetElement(id);
|
||||
return closure->GetElementByID(id);
|
||||
}
|
||||
|
||||
// do we have an offset for it?
|
||||
|
@ -134,10 +134,10 @@ Val* Frame::GetElement(const ID* id) const
|
|||
{
|
||||
auto where = offset_map->find(std::string(id->Name()));
|
||||
if ( where != offset_map->end() )
|
||||
return frame[where->second].get();
|
||||
return frame[where->second];
|
||||
}
|
||||
|
||||
return frame[id->Offset()].get();
|
||||
return frame[id->Offset()];
|
||||
}
|
||||
|
||||
void Frame::Reset(int startIdx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue