mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Change lookup_ID() to return a const-reference
This commit is contained in:
parent
8f95a2a0bb
commit
0af7f8141b
9 changed files with 32 additions and 28 deletions
|
@ -117,9 +117,9 @@ TraversalCode Scope::Traverse(TraversalCallback* cb) const
|
|||
}
|
||||
|
||||
|
||||
IntrusivePtr<ID> lookup_ID(const char* name, const char* curr_module,
|
||||
bool no_global, bool same_module_only,
|
||||
bool check_export)
|
||||
const IntrusivePtr<ID>& lookup_ID(const char* name, const char* curr_module,
|
||||
bool no_global, bool same_module_only,
|
||||
bool check_export)
|
||||
{
|
||||
std::string fullname = make_full_var_name(curr_module, name);
|
||||
|
||||
|
@ -148,7 +148,8 @@ IntrusivePtr<ID> lookup_ID(const char* name, const char* curr_module,
|
|||
return global_scope()->Find(globalname);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
static IntrusivePtr<ID> nil;
|
||||
return nil;
|
||||
}
|
||||
|
||||
IntrusivePtr<ID> install_ID(const char* name, const char* module_name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue