AcctIdx: ref_count_from_storage remove Arc::clone (#26678)

This commit is contained in:
Jeff Washington (jwash) 2022-07-20 10:05:13 -05:00 committed by GitHub
parent 0402c3d0ca
commit 9f2f2a45cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -1657,11 +1657,13 @@ impl<T: IndexValue> AccountsIndex<T> {
}
pub fn ref_count_from_storage(&self, pubkey: &Pubkey) -> RefCount {
if let Some(locked_entry) = self.get_account_read_entry(pubkey) {
locked_entry.ref_count()
} else {
0
}
let map = self.get_account_maps_read_lock(pubkey);
map.get_internal(pubkey, |entry| {
(
false,
entry.map(|entry| entry.ref_count()).unwrap_or_default(),
)
})
}
fn purge_secondary_indexes_by_inner_key<'a>(