From: Jason Ish Date: Tue, 26 Apr 2022 19:25:40 +0000 (-0600) Subject: dns: convert transaction list to vecdeque X-Git-Tag: suricata-7.0.0-beta1~668 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31894147884af3e7151b4d653e5268a0b0477db8;p=thirdparty%2Fsuricata.git dns: convert transaction list to vecdeque Allows for more efficient removal from front of the list. Ticket: #5277 --- diff --git a/rust/src/dns/dns.rs b/rust/src/dns/dns.rs index 4f5cfa8539..fe00d04faa 100644 --- a/rust/src/dns/dns.rs +++ b/rust/src/dns/dns.rs @@ -311,7 +311,7 @@ pub struct DNSState { pub tx_id: u64, // Transactions. - pub transactions: Vec, + pub transactions: VecDeque, pub events: u16, @@ -401,7 +401,7 @@ impl DNSState { let mut tx = self.new_tx(); tx.request = Some(request); - self.transactions.push(tx); + self.transactions.push_back(tx); if z_flag { SCLogDebug!("Z-flag set on DNS response"); @@ -445,7 +445,7 @@ impl DNSState { } } tx.response = Some(response); - self.transactions.push(tx); + self.transactions.push_back(tx); if z_flag { SCLogDebug!("Z-flag set on DNS response");