mirror of
https://github.com/uutils/coreutils
synced 2025-01-19 00:24:13 +00:00
uucore: provide capacity for vectors
This commit is contained in:
parent
8e8b825b45
commit
3de48dcde8
1 changed files with 2 additions and 2 deletions
|
@ -233,7 +233,7 @@ fn test_random_big() {
|
||||||
// to generate an even split of this range, generate n-1 random elements
|
// to generate an even split of this range, generate n-1 random elements
|
||||||
// in the range, add the desired total value to the end, sort this list,
|
// in the range, add the desired total value to the end, sort this list,
|
||||||
// and then compute the sequential differences.
|
// and then compute the sequential differences.
|
||||||
let mut f_bits = Vec::new();
|
let mut f_bits = Vec::with_capacity(n_factors);
|
||||||
for _ in 0..n_factors {
|
for _ in 0..n_factors {
|
||||||
f_bits.push(extra_range.sample(&mut rng));
|
f_bits.push(extra_range.sample(&mut rng));
|
||||||
}
|
}
|
||||||
|
@ -256,7 +256,7 @@ fn test_random_big() {
|
||||||
|
|
||||||
let mut n_bits = 0;
|
let mut n_bits = 0;
|
||||||
let mut product = 1_u64;
|
let mut product = 1_u64;
|
||||||
let mut factors = Vec::new();
|
let mut factors = Vec::with_capacity(f_bits.len());
|
||||||
for bit in f_bits {
|
for bit in f_bits {
|
||||||
assert!(bit < 37);
|
assert!(bit < 37);
|
||||||
n_bits += 14 + bit;
|
n_bits += 14 + bit;
|
||||||
|
|
Loading…
Reference in a new issue