mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
logging: Switch index-assignment of raw pointers to emplace_back()
This commit is contained in:
parent
245fd0c94f
commit
a9290cc031
2 changed files with 10 additions and 6 deletions
|
@ -1158,9 +1158,10 @@ bool Manager::WriteToFilters(const Manager::Stream* stream, zeek::RecordValPtr c
|
|||
if ( zeek::plugin_mgr->HavePluginForHook(zeek::plugin::HOOK_LOG_WRITE) ) {
|
||||
// The current HookLogWrite API takes a threading::Value**.
|
||||
// Fabricate the pointer array on the fly. Mutation is allowed.
|
||||
std::vector<threading::Value*> vals(rec.size());
|
||||
for ( size_t i = 0; i < rec.size(); i++ )
|
||||
vals[i] = &rec[i];
|
||||
std::vector<threading::Value*> vals;
|
||||
vals.reserve(rec.size());
|
||||
for ( auto& v : rec )
|
||||
vals.emplace_back(&v);
|
||||
|
||||
bool res =
|
||||
zeek::plugin_mgr->HookLogWrite(filter->writer->GetType()->AsEnumType()->Lookup(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue