X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=dnsseed-rust;a=blobdiff_plain;f=src%2Fdatastore.rs;h=840863aed4d966988d370f63bdc5a3ecc3742919;hp=354a37d62aa5f63bd96bf5226bb814163d0da829;hb=0e8e7d68a60e43ceaf3aa7b35bdb2317b51f3b07;hpb=85cbeb34b69c8f3dc283b3963c98fd509c067fbf diff --git a/src/datastore.rs b/src/datastore.rs index 354a37d..840863a 100644 --- a/src/datastore.rs +++ b/src/datastore.rs @@ -170,12 +170,12 @@ impl SockAddr { } struct Nodes { - good_node_services: Vec>, + good_node_services: [HashSet; 64], nodes_to_state: HashMap, state_next_scan: Vec>, } struct NodesMutRef<'a> { - good_node_services: &'a mut Vec>, + good_node_services: &'a mut [HashSet; 64], nodes_to_state: &'a mut HashMap, state_next_scan: &'a mut Vec>, } @@ -264,10 +264,7 @@ impl Store { for _ in 0..AddressState::get_count() { state_vecs.push(Vec::new()); } - let mut good_node_services = Vec::with_capacity(64); - for _ in 0..64 { - good_node_services.push(HashSet::new()); - } + let good_node_services = [HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new(), HashSet::new()]; Nodes { good_node_services, nodes_to_state: HashMap::new(),