consolidate another use of remove_if_slot_list_empty (#19804)

This commit is contained in:
Jeff Washington (jwash) 2021-09-12 14:05:44 -05:00 committed by GitHub
parent 62c8bcf565
commit d9674f7ff0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -1710,11 +1710,7 @@ impl<T: IsCached> AccountsIndex<T> {
// remove() below.
if is_slot_list_empty {
let mut w_maps = self.get_account_maps_write_lock(pubkey);
if let Some(x) = w_maps.get(pubkey) {
if x.slot_list.read().unwrap().is_empty() {
w_maps.remove(pubkey);
}
}
w_maps.remove_if_slot_list_empty(*pubkey);
}
}