mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +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
|
* Configuration, cli
|
||||||
* Tests
|
* Tests
|
||||||
* Benchmarks
|
* Optimize extract_response_peers
|
||||||
* Pareto distribution parameters OK?
|
|
||||||
* Clean connections: `state.connections.shrink_to_fit()`?
|
* Clean connections: `state.connections.shrink_to_fit()`?
|
||||||
|
|
||||||
|
|
||||||
## Don't do
|
## Don't do
|
||||||
|
|
||||||
* Other hash algorithms: seemingly not worthwhile
|
* Other hash algorithms: seemingly not worthwhile
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,10 @@ pub fn extract_response_peers(
|
||||||
.collect()
|
.collect()
|
||||||
} else {
|
} else {
|
||||||
peer_map.values()
|
peer_map.values()
|
||||||
.map(Peer::to_response_peer)
|
|
||||||
.choose_multiple(rng, number_of_peers_to_take)
|
.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