mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
announce handler: extract_response_peers: optimize
This commit is contained in:
parent
aa771f6a68
commit
3c411bdbf4
2 changed files with 4 additions and 4 deletions
4
TODO.md
4
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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue