Skip to content

Commit

Permalink
fix CI problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
zealchen committed Feb 24, 2024
1 parent 5adacc6 commit bef6c14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/skiplist/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ fn bench_read_write_skiplist_frac(b: &mut Bencher<'_>, frac: &usize) {
let mut rng = rand::thread_rng();
while !s.load(Ordering::SeqCst) {
let key = random_key(&mut rng);
let case = (key, frac > rng.gen_range(0, 11));
let case = (key, frac > rng.gen_range(0..11));
skiplist_round(&l, &case, &v);
}
});
let mut rng = rand::thread_rng();
b.iter_batched_ref(
|| (random_key(&mut rng), frac > rng.gen_range(0, 11)),
|| (random_key(&mut rng), frac > rng.gen_range(0..11)),
|case| skiplist_round(&list, case, &value),
BatchSize::SmallInput,
);
Expand Down Expand Up @@ -127,15 +127,15 @@ fn bench_read_write_map_frac(b: &mut Bencher<'_>, frac: &usize) {
let handle = thread::spawn(move || {
let mut rng = rand::thread_rng();
while !thread_stop.load(Ordering::SeqCst) {
let f = rng.gen_range(0, 11);
let f = rng.gen_range(0..11);
let case = (random_key(&mut rng), f < frac);
map_round(&map_in_thread, &case, &v);
}
});
let mut rng = rand::thread_rng();
b.iter_batched_ref(
|| {
let f = rng.gen_range(0, 11);
let f = rng.gen_range(0..11);
(random_key(&mut rng), f < frac)
},
|case| map_round(&map, case, &value),
Expand Down
2 changes: 1 addition & 1 deletion src/meta_client/src/load_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl LoadBalancer for RandomLoadBalancer {
return Ok(&addresses[0]);
}
let mut rng = rand::thread_rng();
let idx = rng.gen_range(0, len);
let idx = rng.gen_range(0..len);

Ok(&addresses[idx])
}
Expand Down

0 comments on commit bef6c14

Please sign in to comment.