Skip to content

Commit b6d0a51

Browse files
committed
Remove redundant .len() calls from loop
1 parent 0d40c2c commit b6d0a51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bins/pgun/src/main.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,12 @@ async fn do_bench(client: Client, bench_file: PathBuf, output_file: PathBuf) ->
137137
let mut types = Vec::new();
138138
let mut runs = Vec::new();
139139

140+
let domain_count = config.data.domains.len();
141+
let type_count = config.data.types.len();
142+
140143
for _ in 0..config.bench.runs {
141-
runs.push(rng.gen_range(0..config.data.domains.len()));
142-
types.push(rng.gen_range(0..config.data.types.len()));
144+
runs.push(rng.gen_range(0..domain_count));
145+
types.push(rng.gen_range(0..type_count));
143146
}
144147

145148
// Create delay duration and keep track of current run

0 commit comments

Comments
 (0)