Integrate review feedback

This commit is contained in:
Dominik Charousset 2021-05-26 08:05:14 +02:00
parent 7767c3d36c
commit 3f4b340abb
2 changed files with 3 additions and 2 deletions

View file

@ -76,6 +76,7 @@ static inline void set_option(const char* option, const T& value)
auto ptr = make_intrusive<VectorVal>(zeek::id::string_vec); auto ptr = make_intrusive<VectorVal>(zeek::id::string_vec);
for ( const auto& str : value ) for ( const auto& str : value )
ptr->Append(make_intrusive<StringVal>(str)); ptr->Append(make_intrusive<StringVal>(str));
id->SetVal(std::move(ptr));
} }
else else
{ {

View file

@ -178,12 +178,12 @@ function Broker::__set_metrics_export_prefixes%(filter: string_vec%): bool
%{ %{
zeek::Broker::Manager::ScriptScopeGuard ssg; zeek::Broker::Manager::ScriptScopeGuard ssg;
if ( broker_mgr ) if ( broker_mgr )
{ {
std::vector<std::string> slist; std::vector<std::string> slist;
auto* vval = filter->AsVectorVal(); auto* vval = filter->AsVectorVal();
for ( unsigned index = 0; index < vval->Size(); ++index ) for ( unsigned index = 0; index < vval->Size(); ++index )
slist.emplace_back(vval->StringValAt(index)->ToStdString()); slist.emplace_back(vval->StringValAt(index)->ToStdString());
broker_mgr->SetMetricsExportPrefixes(std::move(slist)); broker_mgr->SetMetricsExportPrefixes(std::move(slist));
} }
return zeek::val_mgr->True(); return zeek::val_mgr->True();
%} %}