2019-05-14 16:42:57 +00:00
|
|
|
use std::hash::BuildHasherDefault;
|
|
|
|
|
2018-07-21 19:15:11 +00:00
|
|
|
pub use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
|
2019-05-14 16:42:57 +00:00
|
|
|
|
2022-07-16 13:16:57 +00:00
|
|
|
pub type StdEntry<'a, K, V> = std::collections::hash_map::Entry<'a, K, V>;
|
|
|
|
|
2019-05-14 16:42:57 +00:00
|
|
|
pub type FxIndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
|
|
|
|
pub type FxIndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
|
2022-07-16 13:16:57 +00:00
|
|
|
pub type IndexEntry<'a, K, V> = indexmap::map::Entry<'a, K, V>;
|
2019-12-24 21:32:36 +00:00
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! define_id_collections {
|
2022-07-16 13:16:57 +00:00
|
|
|
($map_name:ident, $set_name:ident, $entry_name:ident, $key:ty) => {
|
2023-01-17 11:05:01 +00:00
|
|
|
pub type $map_name<T> = $crate::unord::UnordMap<$key, T>;
|
2022-12-02 15:27:25 +00:00
|
|
|
pub type $set_name = $crate::unord::UnordSet<$key>;
|
2022-07-16 13:16:57 +00:00
|
|
|
pub type $entry_name<'a, T> = $crate::fx::StdEntry<'a, $key, T>;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! define_stable_id_collections {
|
|
|
|
($map_name:ident, $set_name:ident, $entry_name:ident, $key:ty) => {
|
|
|
|
pub type $map_name<T> = $crate::fx::FxIndexMap<$key, T>;
|
|
|
|
pub type $set_name = $crate::fx::FxIndexSet<$key>;
|
|
|
|
pub type $entry_name<'a, T> = $crate::fx::IndexEntry<'a, $key, T>;
|
2019-12-24 21:32:36 +00:00
|
|
|
};
|
|
|
|
}
|