From 8dfa83c57950d7fb039423809380a40a84429f5c Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 2 Dec 2021 11:05:54 -0600 Subject: [PATCH] AcctIdx: minor code cleanup (#21547) --- runtime/src/accounts_index.rs | 6 ++---- runtime/src/in_mem_accounts_index.rs | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 2ce7ea4b1a..1f8cf862f5 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -1213,10 +1213,8 @@ impl AccountsIndex { if let AccountIndexGetResult::Found(list_r, index) = self.get(&pubkey, Some(ancestors), max_root) { - func( - &pubkey, - (&list_r.slot_list()[index].1, list_r.slot_list()[index].0), - ); + let entry = &list_r.slot_list()[index]; + func(&pubkey, (&entry.1, entry.0)); } if config.is_aborted() { break; diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index 301dd39a49..5c3e1c77f6 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -156,7 +156,7 @@ impl InMemAccountsIndex { fn get_only_in_mem( &self, pubkey: &K, - callback: impl for<'a> FnOnce(Option<&'a Arc>>) -> RT, + callback: impl for<'a> FnOnce(Option<&'a AccountMapEntry>) -> RT, ) -> RT { let m = Measure::start("get"); let map = self.map().read().unwrap(); @@ -190,7 +190,7 @@ impl InMemAccountsIndex { &self, pubkey: &K, // return true if item should be added to in_mem cache - callback: impl for<'a> FnOnce(Option<&Arc>>) -> (bool, RT), + callback: impl for<'a> FnOnce(Option<&AccountMapEntry>) -> (bool, RT), ) -> RT { self.get_only_in_mem(pubkey, |entry| { if let Some(entry) = entry {