Replaces InMemAccountsIndex::get() with AccountsIndex::get_cloned() (#35352)

This commit is contained in:
Brooks 2024-02-28 14:45:08 -05:00 committed by GitHub
parent 6402198902
commit 7c48cbb7aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -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(