mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
remove distance_histogram
This commit is contained in:
parent
30ff065dc0
commit
b316ce2cbc
|
@ -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> {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue