mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Use .drain(..).flatten()
This commit is contained in:
parent
e9d3c6e5c4
commit
ff709d9d57
|
@ -164,16 +164,14 @@ impl<K, V> HashMap<K, V> {
|
||||||
let mut new_max_distance_to_initial_bucket = 0;
|
let mut new_max_distance_to_initial_bucket = 0;
|
||||||
let number_of_elements = self.number_of_elements;
|
let number_of_elements = self.number_of_elements;
|
||||||
|
|
||||||
for node in self.nodes.0.drain(..) {
|
for node in self.nodes.0.drain(..).flatten() {
|
||||||
if let Some(node) = node {
|
new_max_distance_to_initial_bucket = new_node_storage.insert_new(
|
||||||
new_max_distance_to_initial_bucket = new_node_storage.insert_new(
|
node.key,
|
||||||
node.key,
|
node.value,
|
||||||
node.value,
|
node.hash,
|
||||||
node.hash,
|
number_of_elements,
|
||||||
number_of_elements,
|
new_max_distance_to_initial_bucket,
|
||||||
new_max_distance_to_initial_bucket,
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.nodes = new_node_storage;
|
self.nodes = new_node_storage;
|
||||||
|
|
Loading…
Reference in a new issue