mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
hash_keys bench: use HashSet::with_capacity (#11044)
This commit is contained in:
@ -161,7 +161,7 @@ where
|
||||
let mut preload = strategy.new_tree(&mut runner).unwrap().current();
|
||||
let mut input = strategy.new_tree(&mut runner).unwrap().current();
|
||||
|
||||
let mut unique_keys = HashSet::new();
|
||||
let mut unique_keys = HashSet::with_capacity(preload.len() + input.len());
|
||||
preload.retain(|(k, _)| unique_keys.insert(k.clone()));
|
||||
input.retain(|(k, _)| unique_keys.insert(k.clone()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user