Remove indirection.

This commit is contained in:
Stephen Chung 2022-11-09 21:48:54 +08:00
parent 1b248b5af7
commit 3800a6d9f5

View File

@ -74,12 +74,12 @@ impl BuildHasher for StraightHasherBuilder {
} }
/// Create an instance of the default hasher. /// Create an instance of the default hasher.
#[inline] #[inline(always)]
#[must_use] #[must_use]
pub fn get_hasher() -> ahash::AHasher { pub fn get_hasher() -> ahash::AHasher {
match config::hashing::get_ahash_seed() { match config::hashing::get_ahash_seed() {
&Some([seed1, seed2, seed3, seed4]) if (seed1 | seed2 | seed3 | seed4) != 0 => { Some([seed1, seed2, seed3, seed4]) if (seed1 | seed2 | seed3 | seed4) != 0 => {
ahash::RandomState::with_seeds(seed1, seed2, seed3, seed4).build_hasher() ahash::RandomState::with_seeds(*seed1, *seed2, *seed3, *seed4).build_hasher()
} }
_ => ahash::AHasher::default(), _ => ahash::AHasher::default(),
} }