announce handler: extract_response_peers: optimize

This commit is contained in:
Joakim Frostegård 2020-04-05 16:37:35 +02:00
parent aa771f6a68
commit 3c411bdbf4
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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()
}
}