From d9674f7ff06230b766610800f48ba740071f6e70 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Sun, 12 Sep 2021 14:05:44 -0500 Subject: [PATCH] consolidate another use of remove_if_slot_list_empty (#19804) --- runtime/src/accounts_index.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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); } }