mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
Pre-allocate and re-use Vals for bool, int, count, enum and empty string
This commit is contained in:
parent
dcbef9cbe3
commit
2982765128
136 changed files with 1859 additions and 1811 deletions
|
@ -22,11 +22,11 @@ RecordVal* EncapsulatingConn::GetRecordVal() const
|
|||
|
||||
RecordVal* id_val = new RecordVal(conn_id);
|
||||
id_val->Assign(0, new AddrVal(src_addr));
|
||||
id_val->Assign(1, port_mgr->Get(ntohs(src_port), proto));
|
||||
id_val->Assign(1, val_mgr->GetPort(ntohs(src_port), proto));
|
||||
id_val->Assign(2, new AddrVal(dst_addr));
|
||||
id_val->Assign(3, port_mgr->Get(ntohs(dst_port), proto));
|
||||
id_val->Assign(3, val_mgr->GetPort(ntohs(dst_port), proto));
|
||||
rv->Assign(0, id_val);
|
||||
rv->Assign(1, new EnumVal(type, BifType::Enum::Tunnel::Type));
|
||||
rv->Assign(1, BifType::Enum::Tunnel::Type->GetVal(type));
|
||||
|
||||
rv->Assign(2, new StringVal(uid.Base62("C").c_str()));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue