mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Preallocate all possible PortVals.
The performance benefit is small (maybe ~1% at most), however, it's a trivial change without downsides.
This commit is contained in:
parent
895e7b06b1
commit
1e4964de77
29 changed files with 139 additions and 68 deletions
|
@ -697,7 +697,7 @@ void bro_broker::Manager::Process()
|
|||
{
|
||||
val_list* vl = new val_list;
|
||||
vl->append(new StringVal(u.relation.remote_tuple().first));
|
||||
vl->append(new PortVal(u.relation.remote_tuple().second,
|
||||
vl->append(port_mgr->Get(u.relation.remote_tuple().second,
|
||||
TRANSPORT_TCP));
|
||||
vl->append(new StringVal(u.peer_name));
|
||||
mgr.QueueEvent(Broker::outgoing_connection_established, vl);
|
||||
|
@ -709,7 +709,7 @@ void bro_broker::Manager::Process()
|
|||
{
|
||||
val_list* vl = new val_list;
|
||||
vl->append(new StringVal(u.relation.remote_tuple().first));
|
||||
vl->append(new PortVal(u.relation.remote_tuple().second,
|
||||
vl->append(port_mgr->Get(u.relation.remote_tuple().second,
|
||||
TRANSPORT_TCP));
|
||||
mgr.QueueEvent(Broker::outgoing_connection_broken, vl);
|
||||
}
|
||||
|
@ -720,7 +720,7 @@ void bro_broker::Manager::Process()
|
|||
{
|
||||
val_list* vl = new val_list;
|
||||
vl->append(new StringVal(u.relation.remote_tuple().first));
|
||||
vl->append(new PortVal(u.relation.remote_tuple().second,
|
||||
vl->append(port_mgr->Get(u.relation.remote_tuple().second,
|
||||
TRANSPORT_TCP));
|
||||
mgr.QueueEvent(Broker::outgoing_connection_incompatible, vl);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue