mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +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
|
@ -22,9 +22,9 @@ RecordVal* EncapsulatingConn::GetRecordVal() const
|
|||
|
||||
RecordVal* id_val = new RecordVal(conn_id);
|
||||
id_val->Assign(0, new AddrVal(src_addr));
|
||||
id_val->Assign(1, new PortVal(ntohs(src_port), proto));
|
||||
id_val->Assign(1, port_mgr->Get(ntohs(src_port), proto));
|
||||
id_val->Assign(2, new AddrVal(dst_addr));
|
||||
id_val->Assign(3, new PortVal(ntohs(dst_port), proto));
|
||||
id_val->Assign(3, port_mgr->Get(ntohs(dst_port), proto));
|
||||
rv->Assign(0, id_val);
|
||||
rv->Assign(1, new EnumVal(type, BifType::Enum::Tunnel::Type));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue