AcctIdx: refactor get to use more refs (#20268)

This commit is contained in:
Jeff Washington (jwash)
2021-09-27 19:18:36 -05:00
committed by GitHub
parent 38844a7010
commit af309c126c
2 changed files with 110 additions and 76 deletions

View File

@@ -1176,12 +1176,7 @@ impl<T: IndexValue> AccountsIndex<T> {
let read_lock = self.account_maps[self.bin_calculator.bin_from_pubkey(pubkey)]
.read()
.unwrap();
let get = read_lock.get(pubkey);
get.map(|entry| {
let result = user(&mut entry.slot_list.write().unwrap());
entry.set_dirty(true);
result
})
read_lock.slot_list_mut(pubkey, user)
}
pub fn handle_dead_keys(