Use backing_vec_size rather than nodes.len()

This commit is contained in:
Gwilym Inzani 2023-05-10 16:01:24 +01:00
parent c5341cb5fa
commit 925baced46

View file

@ -139,7 +139,7 @@ impl<K, V, ALLOCATOR: ClonableAllocator> NodeStorage<K, V, ALLOCATOR> {
Q: Eq + ?Sized,
{
for distance_to_initial_bucket in 0..(self.max_distance_to_initial_bucket + 1) {
let location = (hash + distance_to_initial_bucket).fast_mod(self.nodes.len());
let location = (hash + distance_to_initial_bucket).fast_mod(self.backing_vec_size());
let node = &self.nodes[location];
let node_key_ref = node.key_ref()?;