mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Introduce FastIndexMap type alias, and use it for NamedExpressions.
This commit is contained in:
11
src/lib.rs
11
src/lib.rs
@@ -310,12 +310,13 @@ pub type FastHashSet<K> = rustc_hash::FxHashSet<K>;
|
||||
pub type FastIndexSet<K> =
|
||||
indexmap::IndexSet<K, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
|
||||
|
||||
/// Insertion-order-preserving hash map (`IndexMap<K, V>`), but with the same
|
||||
/// hasher as `FastHashMap<K, V>` (faster but not resilient to DoS attacks).
|
||||
pub type FastIndexMap<K, V> =
|
||||
indexmap::IndexMap<K, V, std::hash::BuildHasherDefault<rustc_hash::FxHasher>>;
|
||||
|
||||
/// Map of expressions that have associated variable names
|
||||
pub(crate) type NamedExpressions = indexmap::IndexMap<
|
||||
Handle<Expression>,
|
||||
String,
|
||||
std::hash::BuildHasherDefault<rustc_hash::FxHasher>,
|
||||
>;
|
||||
pub(crate) type NamedExpressions = FastIndexMap<Handle<Expression>, String>;
|
||||
|
||||
/// Early fragment tests.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user