1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::hash::BuildHasherDefault;

use rustc_hash::{FxHashSet, FxHasher};

/// A fast hashmap with no hash DoS protection. This is used in
/// extremely hot code.
///
/// Wrapping FxHasher (the fastest hash algorithm in difftastic
/// benchmarks) in a hashbrown::HashMap rather than std HashMap is a
/// little faster, and it also allows us to use the entry_ref API
/// which is unavailable in stable Rust.
pub(crate) type DftHashMap<K, V> = hashbrown::HashMap<K, V, BuildHasherDefault<FxHasher>>;

/// A fast hash set with no hash DoS protection. This is a simple
/// alias, but added for consistency with `DftHashMap`.
pub(crate) type DftHashSet<V> = FxHashSet<V>;