Skip to content

Commit

Permalink
Run ./x fmt --all
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiTRex committed Aug 11, 2024
1 parent 5413186 commit a9292f7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions library/core/benches/num/int_sqrt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ macro_rules! int_sqrt_bench {
fn $random(bench: &mut Bencher) {
let mut rng = crate::bench_rng();
/* Exponentially distributed random numbers from the whole range of the type. */
let numbers: Vec<$t> = (0..256)
.map(|_| rng.gen::<$t>() >> rng.gen_range(0..<$t>::BITS))
.collect();
let numbers: Vec<$t> =
(0..256).map(|_| rng.gen::<$t>() >> rng.gen_range(0..<$t>::BITS)).collect();
bench.iter(|| {
for x in &numbers {
black_box(black_box(x).isqrt());
Expand All @@ -33,9 +32,8 @@ macro_rules! int_sqrt_bench {
fn $random_small(bench: &mut Bencher) {
let mut rng = crate::bench_rng();
/* Exponentially distributed random numbers from the range 0..256. */
let numbers: Vec<$t> = (0..256)
.map(|_| (rng.gen::<u8>() >> rng.gen_range(0..u8::BITS)) as $t)
.collect();
let numbers: Vec<$t> =
(0..256).map(|_| (rng.gen::<u8>() >> rng.gen_range(0..u8::BITS)) as $t).collect();
bench.iter(|| {
for x in &numbers {
black_box(black_box(x).isqrt());
Expand All @@ -47,9 +45,7 @@ macro_rules! int_sqrt_bench {
fn $random_uniform(bench: &mut Bencher) {
let mut rng = crate::bench_rng();
/* Exponentially distributed random numbers from the whole range of the type. */
let numbers: Vec<$t> = (0..256)
.map(|_| rng.gen::<$t>())
.collect();
let numbers: Vec<$t> = (0..256).map(|_| rng.gen::<$t>()).collect();
bench.iter(|| {
for x in &numbers {
black_box(black_box(x).isqrt());
Expand Down

0 comments on commit a9292f7

Please sign in to comment.