From 36fcc74072bf324b5932632c536635a8daf00e1b Mon Sep 17 00:00:00 2001 From: brooks Date: Sat, 17 Feb 2024 14:58:11 -0700 Subject: [PATCH] Replaces get_account_read_entry() in ancient append vecs --- accounts-db/src/ancient_append_vecs.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/accounts-db/src/ancient_append_vecs.rs b/accounts-db/src/ancient_append_vecs.rs index 4566a8923924d2..1ebcc77763ae27 100644 --- a/accounts-db/src/ancient_append_vecs.rs +++ b/accounts-db/src/ancient_append_vecs.rs @@ -1506,11 +1506,9 @@ pub mod tests { if two_refs { original_results.iter().for_each(|results| { results.stored_accounts.iter().for_each(|account| { - let entry = db - .accounts_index - .get_account_read_entry(account.pubkey()) - .unwrap(); - entry.addref(); + db.accounts_index.get_and_then(account.pubkey(), |entry| { + (false, entry.unwrap().addref()) + }); }) }); } @@ -1854,11 +1852,8 @@ pub mod tests { ); original_results.iter().for_each(|results| { results.stored_accounts.iter().for_each(|account| { - let entry = db - .accounts_index - .get_account_read_entry(account.pubkey()) - .unwrap(); - entry.addref(); + db.accounts_index + .get_and_then(account.pubkey(), |entry| (true, entry.unwrap().addref())); }) });