From ba36134c01513a8cc1367ed78d4090d91f7a8e70 Mon Sep 17 00:00:00 2001 From: Aria Shrimpton Date: Tue, 27 Feb 2024 09:42:49 +0000 Subject: change example_{mapping,sets} to do 2* as many gets/contains as inserts --- src/tests/example_mapping/src/lib.rs | 2 +- src/tests/example_sets/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tests') diff --git a/src/tests/example_mapping/src/lib.rs b/src/tests/example_mapping/src/lib.rs index 335c55c..f9216df 100644 --- a/src/tests/example_mapping/src/lib.rs +++ b/src/tests/example_mapping/src/lib.rs @@ -13,7 +13,7 @@ pub fn insert_get(n: usize) { set.insert(i.to_string(), random()); } - for i in 0..n * n { + for i in 0..2 * n { black_box(|x| x)(black_box(set.get(&i.to_string()))); } } diff --git a/src/tests/example_sets/src/lib.rs b/src/tests/example_sets/src/lib.rs index 8e6caa5..dff5a27 100644 --- a/src/tests/example_sets/src/lib.rs +++ b/src/tests/example_sets/src/lib.rs @@ -14,7 +14,7 @@ pub fn insert_n(n: usize) { set.insert(random()); } - for i in 0..n * n { + for i in 0..2 * n { black_box(|x| x)(black_box(set.contains(&i))); } } -- cgit v1.2.3