Skip to content

Commit

Permalink
use num instead of capacity in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jotabulacios committed Jan 23, 2025
1 parent f215bda commit d021a1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions math/benches/fields/baby_bear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ type EF4 = BinomialExtensionField<BabyBear, 4>;

pub fn rand_field_elements_u32(num: usize) -> Vec<(F, F)> {
let mut result = Vec::with_capacity(num);
for _ in 0..result.capacity() {
for _ in 0..num {
result.push((F::from(random::<u64>()), F::from(random::<u64>())));
}
result
}

pub fn rand_field_elements_u64(num: usize) -> Vec<(F64, F64)> {
let mut result = Vec::with_capacity(num);
for _ in 0..result.capacity() {
for _ in 0..num {
result.push((F64::from(random::<u64>()), F64::from(random::<u64>())));
}
result
Expand Down

0 comments on commit d021a1d

Please # to comment.