accounts index get returns value (#19777)
This commit is contained in:
parent
999ba9e026
commit
7de2236284
|
@ -246,9 +246,10 @@ impl<T: IsCached> WriteAccountMapEntry<T> {
|
|||
reclaims: &mut SlotList<T>,
|
||||
previous_slot_entry_was_cached: bool,
|
||||
) -> bool {
|
||||
// (possibly) non-ideal clone of arc here
|
||||
if let Some(current) = r_account_maps.get(pubkey) {
|
||||
Self::lock_and_update_slot_list(
|
||||
current,
|
||||
¤t,
|
||||
new_value,
|
||||
reclaims,
|
||||
previous_slot_entry_was_cached,
|
||||
|
@ -1191,7 +1192,6 @@ impl<T: IsCached> AccountsIndex<T> {
|
|||
lock: &AccountMapsReadLock<'_, T>,
|
||||
) -> Option<ReadAccountMapEntry<T>> {
|
||||
lock.get(pubkey)
|
||||
.cloned()
|
||||
.map(ReadAccountMapEntry::from_account_map_entry)
|
||||
}
|
||||
|
||||
|
@ -1200,7 +1200,6 @@ impl<T: IsCached> AccountsIndex<T> {
|
|||
.read()
|
||||
.unwrap()
|
||||
.get(pubkey)
|
||||
.cloned()
|
||||
.map(WriteAccountMapEntry::from_account_map_entry)
|
||||
}
|
||||
|
||||
|
@ -1459,7 +1458,6 @@ impl<T: IsCached> AccountsIndex<T> {
|
|||
.unwrap();
|
||||
let account = read_lock
|
||||
.get(pubkey)
|
||||
.cloned()
|
||||
.map(ReadAccountMapEntry::from_account_map_entry);
|
||||
|
||||
match account {
|
||||
|
|
|
@ -34,8 +34,8 @@ impl<V: IsCached> InMemAccountsIndex<V> {
|
|||
self.map.keys()
|
||||
}
|
||||
|
||||
pub fn get(&self, key: &K) -> Option<&AccountMapEntry<V>> {
|
||||
self.map.get(key)
|
||||
pub fn get(&self, key: &K) -> Option<AccountMapEntry<V>> {
|
||||
self.map.get(key).cloned()
|
||||
}
|
||||
|
||||
pub fn remove(&mut self, key: &K) {
|
||||
|
|
Loading…
Reference in New Issue