mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
Deprecate Scope::Lookup(), replace with Scope::Find()
This commit is contained in:
parent
a5762c12cc
commit
8f95a2a0bb
27 changed files with 65 additions and 72 deletions
14
src/Scope.h
14
src/Scope.h
|
@ -22,14 +22,22 @@ public:
|
|||
~Scope() override;
|
||||
|
||||
template<typename N>
|
||||
ID* Lookup(N&& name) const
|
||||
const IntrusivePtr<ID>& Find(N&& name) const
|
||||
{
|
||||
static IntrusivePtr<ID> nil;
|
||||
const auto& entry = local.find(std::forward<N>(name));
|
||||
|
||||
if ( entry != local.end() )
|
||||
return entry->second.get();
|
||||
return entry->second;
|
||||
|
||||
return nullptr;
|
||||
return nil;
|
||||
}
|
||||
|
||||
template<typename N>
|
||||
[[deprecated("Remove in v4.1. Use Find().")]]
|
||||
ID* Lookup(N&& name) const
|
||||
{
|
||||
return Find(name).get();
|
||||
}
|
||||
|
||||
template<typename N, typename I>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue