Skip to content

Commit

Permalink
replace if-then-else by then_some
Browse files Browse the repository at this point in the history
  • Loading branch information
dmakarov committed Aug 5, 2024
1 parent 4f1994d commit 2b7efbf
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3489,17 +3489,13 @@ impl AccountsDb {
slot_list,
ref_count: _,
} = cleaning_info;
if slot_list.is_empty() {
None
} else {
Some((
*pubkey,
slot_list
.iter()
.map(|(slot, _)| *slot)
.collect::<HashSet<Slot>>(),
))
}
(!slot_list.is_empty()).then_some((
*pubkey,
slot_list
.iter()
.map(|(slot, _)| *slot)
.collect::<HashSet<Slot>>(),
))
})
.collect::<Vec<_>>();
pubkey_to_slot_set.append(&mut bin_set);
Expand Down

0 comments on commit 2b7efbf

Please sign in to comment.