diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 7a182537a0..9e4346d8dd 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -246,9 +246,10 @@ impl WriteAccountMapEntry { reclaims: &mut SlotList, 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 AccountsIndex { lock: &AccountMapsReadLock<'_, T>, ) -> Option> { lock.get(pubkey) - .cloned() .map(ReadAccountMapEntry::from_account_map_entry) } @@ -1200,7 +1200,6 @@ impl AccountsIndex { .read() .unwrap() .get(pubkey) - .cloned() .map(WriteAccountMapEntry::from_account_map_entry) } @@ -1459,7 +1458,6 @@ impl AccountsIndex { .unwrap(); let account = read_lock .get(pubkey) - .cloned() .map(ReadAccountMapEntry::from_account_map_entry); match account { diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index 8227d7c891..d44a189a55 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -34,8 +34,8 @@ impl InMemAccountsIndex { self.map.keys() } - pub fn get(&self, key: &K) -> Option<&AccountMapEntry> { - self.map.get(key) + pub fn get(&self, key: &K) -> Option> { + self.map.get(key).cloned() } pub fn remove(&mut self, key: &K) {