mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08: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
|
@ -34,9 +34,9 @@ static RecordVal* get_conn_id_val(const Connection* conn)
|
|||
{
|
||||
RecordVal* v = new RecordVal(conn_id);
|
||||
v->Assign(0, new AddrVal(conn->OrigAddr()));
|
||||
v->Assign(1, new PortVal(ntohs(conn->OrigPort()), conn->ConnTransport()));
|
||||
v->Assign(1, port_mgr->Get(ntohs(conn->OrigPort()), conn->ConnTransport()));
|
||||
v->Assign(2, new AddrVal(conn->RespAddr()));
|
||||
v->Assign(3, new PortVal(ntohs(conn->RespPort()), conn->ConnTransport()));
|
||||
v->Assign(3, port_mgr->Get(ntohs(conn->RespPort()), conn->ConnTransport()));
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue