From 7c48cbb7aa702c68608cd5928975ec99dc274feb Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 28 Feb 2024 14:45:08 -0500 Subject: [PATCH] Replaces InMemAccountsIndex::get() with AccountsIndex::get_cloned() (#35352) --- accounts-db/src/accounts_db.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 3402c42f4..167cbdbfa 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -9068,11 +9068,10 @@ impl AccountsDb { let mut lookup_time = Measure::start("lookup_time"); for account_info in storage.accounts.account_iter() { let key = account_info.pubkey(); - let lock = self.accounts_index.get_bin(key); - let x = lock.get(key).unwrap(); - let sl = x.slot_list.read().unwrap(); + let index_entry = self.accounts_index.get_cloned(key).unwrap(); + let slot_list = index_entry.slot_list.read().unwrap(); let mut count = 0; - for (slot2, account_info2) in sl.iter() { + for (slot2, account_info2) in slot_list.iter() { if slot2 == slot { count += 1; let ai = AccountInfo::new(