8000 uucore: provide capacity for vectors by shinhs0506 · Pull Request #5086 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

uucore: provide capacity for vectors #5086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/by-util/test_factor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fn test_random_big() {
// 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,
// and then compute the sequential differences.
let mut f_bits = Vec::new();
let mut f_bits = Vec::with_capacity(n_factors + 1);
for _ in 0..n_factors {
f_bits.push(extra_range.sample(&mut rng));
}
Expand All @@ -256,7 +256,7 @@ fn test_random_big() {

let mut n_bits = 0;
let mut product = 1_u64;
let mut factors = Vec::new();
let mut factors = Vec::with_capacity(f_bits.len());
for bit in f_bits {
assert!(bit < 37);
n_bits += 14 + bit;
Expand Down
0