diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 4ae9d1755b..724e25c1f5 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -1710,11 +1710,7 @@ impl AccountsIndex { // 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); } }