mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
cluster/Telemetry: Avoid unneeded StringVal() construction
This commit is contained in:
parent
dad5ccd622
commit
be8b4747c4
1 changed files with 1 additions and 5 deletions
|
@ -22,11 +22,7 @@ TableTopicNormalizer::TableTopicNormalizer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string_view TableTopicNormalizer::operator()(std::string_view topic) {
|
std::string_view TableTopicNormalizer::operator()(std::string_view topic) {
|
||||||
// TODO: It'd be nice if we could just lookup via string_view so we can
|
VectorValPtr r = topic_normalizations->LookupPattern(topic);
|
||||||
// avoid the allocation of the intermediary StringVal just to match
|
|
||||||
// against the patterns.
|
|
||||||
auto sv = zeek::make_intrusive<zeek::StringVal>(topic);
|
|
||||||
VectorValPtr r = topic_normalizations->LookupPattern(sv);
|
|
||||||
|
|
||||||
if ( r->Size() == 0 )
|
if ( r->Size() == 0 )
|
||||||
return topic;
|
return topic;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue