cleanup get_closeset_completion (#30516)

This commit is contained in:
Jeff Biseda 2023-02-27 16:56:40 -08:00 committed by GitHub
parent 50f069af43
commit 781a7cbd28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -117,13 +117,11 @@ pub fn get_closest_completion(
limit: usize, limit: usize,
) -> (Vec<ShredRepairType>, /* processed slots */ usize) { ) -> (Vec<ShredRepairType>, /* processed slots */ usize) {
let mut slot_dists: Vec<(Slot, u64)> = Vec::default(); let mut slot_dists: Vec<(Slot, u64)> = Vec::default();
let mut explored_slots: HashSet<Slot> = HashSet::default();
let iter = GenericTraversal::new(tree); let iter = GenericTraversal::new(tree);
for slot in iter { for slot in iter {
if processed_slots.contains(&slot) || explored_slots.contains(&slot) { if processed_slots.contains(&slot) {
continue; continue;
} }
explored_slots.insert(slot);
let slot_meta = slot_meta_cache let slot_meta = slot_meta_cache
.entry(slot) .entry(slot)
.or_insert_with(|| blockstore.meta(slot).unwrap()); .or_insert_with(|| blockstore.meta(slot).unwrap());