use std::collections::HashMap;
use std::hash::{BuildHasherDefault, Hasher};
#[derive(Default)]
pub(super) struct FxHasher(u64);
impl Hasher for FxHasher {
#[inline(always)]
fn write(&mut self, bytes: &[u8]) {
const K: u64 = 0x517cc1b727220a95;
for byte in bytes {
self.0 = (self.0.rotate_left(5) ^ (*byte as u64)).wrapping_mul(K);
}
}
#[inline(always)]
fn write_u32(&mut self, i: u32) {
const K: u64 = 0x517cc1b727220a95;
self.0 = (self.0.rotate_left(5) ^ (i as u64)).wrapping_mul(K);
}
#[inline(always)]
fn finish(&self) -> u64 {
self.0
}
}
pub(super) type FxHashMap<K, V> = HashMap<K, V, BuildHasherDefault<FxHasher>>;