From b316ce2cbc49127c5b05d792acb76b69f01279f0 Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 14 May 2024 22:35:39 +0100 Subject: [PATCH] remove distance_histogram --- agb-hashmap/src/lib.rs | 6 ------ agb-hashmap/src/node_storage.rs | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/agb-hashmap/src/lib.rs b/agb-hashmap/src/lib.rs index 7114232c..d491f727 100644 --- a/agb-hashmap/src/lib.rs +++ b/agb-hashmap/src/lib.rs @@ -174,12 +174,6 @@ impl HashMap { pub fn with_capacity(capacity: usize) -> Self { Self::with_capacity_in(capacity, Global) } - - #[doc(hidden)] - #[must_use] - pub fn distance_histogram(&self) -> (Vec, usize) { - self.nodes.distance_histogram() - } } impl HashMap { diff --git a/agb-hashmap/src/node_storage.rs b/agb-hashmap/src/node_storage.rs index e7483671..c791fec7 100644 --- a/agb-hashmap/src/node_storage.rs +++ b/agb-hashmap/src/node_storage.rs @@ -202,22 +202,6 @@ impl NodeStorage { self.nodes.get_unchecked_mut(at) } - pub(crate) fn distance_histogram(&self) -> (Vec, usize) { - let mut ret = Vec::new(); - - for node in self.nodes.iter() { - let distance = node.distance(); - - if distance >= 0 { - let distance = distance as usize; - ret.resize(ret.len().max(distance + 1), 0); - ret[distance] += 1; - } - } - - (ret, self.max_distance_to_initial_bucket as usize) - } - pub(crate) fn clear(&mut self) { self.max_distance_to_initial_bucket = 0; self.number_of_items = 0;