From 31894147884af3e7151b4d653e5268a0b0477db8 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 26 Apr 2022 13:25:40 -0600 Subject: [PATCH] dns: convert transaction list to vecdeque Allows for more efficient removal from front of the list. Ticket: #5277 --- rust/src/dns/dns.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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");