mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Factor static-local nil IntrusivePtrs to global locations
Minor optimization to remove any run-time impact.
This commit is contained in:
parent
a384bb8b81
commit
ea878208ba
8 changed files with 21 additions and 23 deletions
|
@ -28,8 +28,6 @@ EventHandler::operator bool() const
|
|||
|
||||
const IntrusivePtr<FuncType>& EventHandler::GetType(bool check_export)
|
||||
{
|
||||
static IntrusivePtr<FuncType> nil;
|
||||
|
||||
if ( type )
|
||||
return type;
|
||||
|
||||
|
@ -37,10 +35,10 @@ const IntrusivePtr<FuncType>& EventHandler::GetType(bool check_export)
|
|||
check_export);
|
||||
|
||||
if ( ! id )
|
||||
return nil;
|
||||
return FuncType::nil;
|
||||
|
||||
if ( id->GetType()->Tag() != TYPE_FUNC )
|
||||
return nil;
|
||||
return FuncType::nil;
|
||||
|
||||
type = id->GetType<FuncType>();
|
||||
return type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue