clone -> Arc::clone to make cost clear (#20262)

This commit is contained in:
Jeff Washington (jwash) 2021-09-27 16:49:53 -05:00 committed by GitHub
parent 4f83818fdb
commit bbd2f9672d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
let mut result = Vec::with_capacity(map.len());
map.iter().for_each(|(k, v)| {
if range.map(|range| range.contains(k)).unwrap_or(true) {
result.push((*k, v.clone()));
result.push((*k, Arc::clone(v)));
}
});
self.start_stop_flush(false);
@ -151,7 +151,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
result
}
// lookup 'pubkey' in index
/// lookup 'pubkey' in index (in mem or on disk)
pub fn get(&self, pubkey: &K) -> Option<AccountMapEntry<T>> {
let result = self.get_only_in_mem(pubkey);
if result.is_some() {