diff options
-rw-r--r-- | src/crates/benchmarker/src/container.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/crates/benchmarker/src/container.rs b/src/crates/benchmarker/src/container.rs index 4e7b12c..e071c5a 100644 --- a/src/crates/benchmarker/src/container.rs +++ b/src/crates/benchmarker/src/container.rs @@ -49,7 +49,7 @@ where let mut c = T::default(); // decide where the element that we will search for will be - let pivot = rng.gen_range(0..n); + let pivot = rng.gen_range(n / 4..n / 2 + n / 4); // insert the element at pivot, and keep track of what it is for _ in 0..pivot { @@ -63,9 +63,7 @@ where (c, chosen) }, - |(c, search)| { - c.contains(search); - }, + |(c, search)| c.contains(search), ); print_results("contains", n, &results); @@ -96,9 +94,7 @@ where (c, chosen) }, - |(c, remove)| { - c.remove(*remove); - }, + |(c, remove)| c.remove(*remove), ); print_results("remove", n, &results); @@ -119,9 +115,7 @@ where c }, - |c| { - c.clear(); - }, + |c| c.clear(), ); print_results("clear", n, &results); |