mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Add Component::GetCanonicalNameVal to avoid extra StringVal allocations
This commit is contained in:
parent
22ab3bb0b3
commit
a680c2faf0
5 changed files with 51 additions and 3 deletions
|
@ -103,8 +103,7 @@ function Files::__stop%(file_id: string%): bool
|
|||
## :zeek:see:`Files::analyzer_name`.
|
||||
function Files::__analyzer_name%(tag: Files::Tag%) : string
|
||||
%{
|
||||
const auto& n = zeek::file_mgr->GetComponentName(zeek::IntrusivePtr{zeek::NewRef{}, tag->AsEnumVal()});
|
||||
return zeek::make_intrusive<zeek::StringVal>(n);
|
||||
return zeek::file_mgr->GetComponentNameVal(zeek::IntrusivePtr{zeek::NewRef{}, tag->AsEnumVal()});
|
||||
%}
|
||||
|
||||
## :zeek:see:`Files::file_exists`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue