mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
IntrusivePtr: replace the "add_ref" parameter with tag structs
Using a runtime parameter is obscure and error-prone. Avoiding error-prone code and getting reference counting right is the whole point of this class.
This commit is contained in:
parent
7c0863dccf
commit
31b3a56740
7 changed files with 41 additions and 15 deletions
|
@ -207,7 +207,7 @@ static IntrusivePtr<EnumVal> lookup_enum_val(const char* module_name, const char
|
|||
|
||||
int index = et->Lookup(module_name, name);
|
||||
assert(index >= 0);
|
||||
IntrusivePtr<EnumVal> rval{et->GetVal(index), false};
|
||||
IntrusivePtr<EnumVal> rval{AdoptRef{}, et->GetVal(index)};
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue