AcctIdx: minor code cleanup (#21547)
This commit is contained in:
parent
6bb884836c
commit
8dfa83c579
|
@ -1213,10 +1213,8 @@ impl<T: IndexValue> AccountsIndex<T> {
|
||||||
if let AccountIndexGetResult::Found(list_r, index) =
|
if let AccountIndexGetResult::Found(list_r, index) =
|
||||||
self.get(&pubkey, Some(ancestors), max_root)
|
self.get(&pubkey, Some(ancestors), max_root)
|
||||||
{
|
{
|
||||||
func(
|
let entry = &list_r.slot_list()[index];
|
||||||
&pubkey,
|
func(&pubkey, (&entry.1, entry.0));
|
||||||
(&list_r.slot_list()[index].1, list_r.slot_list()[index].0),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if config.is_aborted() {
|
if config.is_aborted() {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -156,7 +156,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
|
||||||
fn get_only_in_mem<RT>(
|
fn get_only_in_mem<RT>(
|
||||||
&self,
|
&self,
|
||||||
pubkey: &K,
|
pubkey: &K,
|
||||||
callback: impl for<'a> FnOnce(Option<&'a Arc<AccountMapEntryInner<T>>>) -> RT,
|
callback: impl for<'a> FnOnce(Option<&'a AccountMapEntry<T>>) -> RT,
|
||||||
) -> RT {
|
) -> RT {
|
||||||
let m = Measure::start("get");
|
let m = Measure::start("get");
|
||||||
let map = self.map().read().unwrap();
|
let map = self.map().read().unwrap();
|
||||||
|
@ -190,7 +190,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
|
||||||
&self,
|
&self,
|
||||||
pubkey: &K,
|
pubkey: &K,
|
||||||
// return true if item should be added to in_mem cache
|
// return true if item should be added to in_mem cache
|
||||||
callback: impl for<'a> FnOnce(Option<&Arc<AccountMapEntryInner<T>>>) -> (bool, RT),
|
callback: impl for<'a> FnOnce(Option<&AccountMapEntry<T>>) -> (bool, RT),
|
||||||
) -> RT {
|
) -> RT {
|
||||||
self.get_only_in_mem(pubkey, |entry| {
|
self.get_only_in_mem(pubkey, |entry| {
|
||||||
if let Some(entry) = entry {
|
if let Some(entry) = entry {
|
||||||
|
|
Loading…
Reference in New Issue