]> git.bitcoin.ninja Git - dnsseed-rust/commitdiff
Bump nodes_buff prealloc to match current avg char/line
authorMatt Corallo <git@bluematt.me>
Wed, 22 Jul 2020 18:25:16 +0000 (14:25 -0400)
committerMatt Corallo <git@bluematt.me>
Wed, 22 Jul 2020 18:25:16 +0000 (14:25 -0400)
src/datastore.rs

index 5aa4748d732e25b84c11e3b5706a344aa3f69ee2..0b608f9f536397d60740f8fc8cbf0fc112b74299 100644 (file)
@@ -470,7 +470,7 @@ impl Store {
                        let mut nodes_buff = String::new();
                        {
                                let nodes = self.nodes.read().unwrap();
-                               nodes_buff.reserve(nodes.nodes_to_state.len() * 20);
+                               nodes_buff.reserve(nodes.nodes_to_state.len() * 32);
                                for (ref sockaddr, ref node) in nodes.nodes_to_state.iter() {
                                        nodes_buff += &sockaddr.to_string();
                                        nodes_buff += ",";