From 9f25f67e6016dc8bd2ff7a7455eacf4cecbbc318 Mon Sep 17 00:00:00 2001 From: Brooks Date: Thu, 9 Nov 2023 16:06:15 -0500 Subject: [PATCH] Simplifies adding uncleaned pubkeys during index generation (#34007) --- accounts-db/src/accounts_db.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 9b1690f8721621..445bc6d10347de 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -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}, @@ -9368,12 +9365,7 @@ impl AccountsDb { let unique_keys = HashSet::::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::>();