diff --git a/TODO.md b/TODO.md index b3f6143..b8cf520 100644 --- a/TODO.md +++ b/TODO.md @@ -2,11 +2,9 @@ * Configuration, cli * Tests -* Benchmarks - * Pareto distribution parameters OK? +* Optimize extract_response_peers * Clean connections: `state.connections.shrink_to_fit()`? - ## Don't do * Other hash algorithms: seemingly not worthwhile diff --git a/aquatic/src/lib/handlers.rs b/aquatic/src/lib/handlers.rs index 3150fcf..e77d49b 100644 --- a/aquatic/src/lib/handlers.rs +++ b/aquatic/src/lib/handlers.rs @@ -177,8 +177,10 @@ pub fn extract_response_peers( .collect() } else { peer_map.values() - .map(Peer::to_response_peer) .choose_multiple(rng, number_of_peers_to_take) + .into_iter() + .map(Peer::to_response_peer) + .collect() } }