From 79571315bea666a84ccaa64e84e7d7cc3ea036f8 Mon Sep 17 00:00:00 2001 From: malik Date: Tue, 12 Aug 2025 20:34:52 +0100 Subject: [PATCH] perf: use unwrap and save 198 cycles (#17836) --- crates/transaction-pool/src/pool/parked.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/transaction-pool/src/pool/parked.rs b/crates/transaction-pool/src/pool/parked.rs index bb16b9c80a..86f02ae0b8 100644 --- a/crates/transaction-pool/src/pool/parked.rs +++ b/crates/transaction-pool/src/pool/parked.rs @@ -189,7 +189,7 @@ impl ParkedPool { while !self.last_sender_submission.is_empty() && limit.is_exceeded(self.len(), self.size()) { // NOTE: This will not panic due to `!last_sender_transaction.is_empty()` - let sender_id = self.last_sender_submission.last().expect("not empty").sender_id; + let sender_id = self.last_sender_submission.last().unwrap().sender_id; let list = self.get_txs_by_sender(sender_id); // Drop transactions from this sender until the pool is under limits