remove distance_histogram

This commit is contained in:
Corwin 2024-05-14 22:35:39 +01:00
parent 30ff065dc0
commit b316ce2cbc
No known key found for this signature in database
2 changed files with 0 additions and 22 deletions

View file

@ -174,12 +174,6 @@ impl<K, V> HashMap<K, V> {
pub fn with_capacity(capacity: usize) -> Self { pub fn with_capacity(capacity: usize) -> Self {
Self::with_capacity_in(capacity, Global) Self::with_capacity_in(capacity, Global)
} }
#[doc(hidden)]
#[must_use]
pub fn distance_histogram(&self) -> (Vec<usize>, usize) {
self.nodes.distance_histogram()
}
} }
impl<K, V, ALLOCATOR: ClonableAllocator> HashMap<K, V, ALLOCATOR> { impl<K, V, ALLOCATOR: ClonableAllocator> HashMap<K, V, ALLOCATOR> {

View file

@ -202,22 +202,6 @@ impl<K, V, ALLOCATOR: ClonableAllocator> NodeStorage<K, V, ALLOCATOR> {
self.nodes.get_unchecked_mut(at) self.nodes.get_unchecked_mut(at)
} }
pub(crate) fn distance_histogram(&self) -> (Vec<usize>, 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) { pub(crate) fn clear(&mut self) {
self.max_distance_to_initial_bucket = 0; self.max_distance_to_initial_bucket = 0;
self.number_of_items = 0; self.number_of_items = 0;