Skip to content

Commit

Permalink
Simplifies adding uncleaned pubkeys during index generation (solana-l…
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Nov 9, 2023
1 parent a96be5d commit 9f25f67
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ use {
},
blake3::traits::digest::Digest,
crossbeam_channel::{unbounded, Receiver, Sender},
dashmap::{
mapref::entry::Entry::{Occupied, Vacant},
DashMap, DashSet,
},
dashmap::{DashMap, DashSet},
log::*,
rand::{thread_rng, Rng},
rayon::{prelude::*, ThreadPool},
Expand Down Expand Up @@ -9368,12 +9365,7 @@ impl AccountsDb {
let unique_keys =
HashSet::<Pubkey>::from_iter(slot_keys.iter().map(|(_, key)| *key));
for (slot, key) in slot_keys {
match self.uncleaned_pubkeys.entry(slot) {
Occupied(mut occupied) => occupied.get_mut().push(key),
Vacant(vacant) => {
vacant.insert(vec![key]);
}
}
self.uncleaned_pubkeys.entry(slot).or_default().push(key);
}
let unique_pubkeys_by_bin_inner =
unique_keys.into_iter().collect::<Vec<_>>();
Expand Down

0 comments on commit 9f25f67

Please sign in to comment.