mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
Update rand to 0.8 and rand_distr to 0.4
This commit is contained in:
parent
de3042bf4a
commit
e1260d14de
12 changed files with 89 additions and 54 deletions
|
|
@ -12,4 +12,4 @@ name = "aquatic_common"
|
|||
|
||||
[dependencies]
|
||||
indexmap = "1"
|
||||
rand = { version = "0.7", features = ["small_rng"] }
|
||||
rand = { version = "0.8", features = ["small_rng"] }
|
||||
|
|
@ -57,12 +57,10 @@ pub fn extract_response_peers<K, V, R, F>(
|
|||
let half_peer_map_len = peer_map_len / 2;
|
||||
|
||||
let offset_first_half = rng.gen_range(
|
||||
0,
|
||||
(half_peer_map_len + (peer_map_len % 2)) - half_num_to_take
|
||||
0..(half_peer_map_len + (peer_map_len % 2)) - half_num_to_take
|
||||
);
|
||||
let offset_second_half = rng.gen_range(
|
||||
half_peer_map_len,
|
||||
peer_map_len - half_num_to_take
|
||||
half_peer_map_len..peer_map_len - half_num_to_take
|
||||
);
|
||||
|
||||
let end_first_half = offset_first_half + half_num_to_take;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue