diff --git a/src/func/hashing.rs b/src/func/hashing.rs index 75331f66..e81cabdd 100644 --- a/src/func/hashing.rs +++ b/src/func/hashing.rs @@ -47,11 +47,11 @@ impl Hasher for StraightHasher { fn finish(&self) -> u64 { self.0 } - #[inline] + #[inline(always)] fn write(&mut self, _bytes: &[u8]) { panic!("StraightHasher can only hash u64 values"); } - + #[inline(always)] fn write_u64(&mut self, i: u64) { if i == 0 { self.0 = ALT_ZERO_HASH; diff --git a/src/module/mod.rs b/src/module/mod.rs index 51e1d0ea..5d897e01 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -278,9 +278,9 @@ pub struct Module { /// Native Rust functions (in scripted hash format) that contain [`Dynamic`] parameters. dynamic_functions: StraightHashSet, /// Iterator functions, keyed by the type producing the iterator. - type_iterators: StraightHashMap>, + type_iterators: BTreeMap>, /// Flattened collection of iterator functions, including those in sub-modules. - all_type_iterators: StraightHashMap>, + all_type_iterators: BTreeMap>, /// Is the [`Module`] indexed? indexed: bool, /// Does the [`Module`] contain indexed functions that have been exposed to the global namespace? @@ -378,8 +378,8 @@ impl Module { functions: StraightHashMap::default(), all_functions: StraightHashMap::default(), dynamic_functions: StraightHashSet::default(), - type_iterators: StraightHashMap::default(), - all_type_iterators: StraightHashMap::default(), + type_iterators: BTreeMap::new(), + all_type_iterators: BTreeMap::new(), indexed: true, contains_indexed_global_functions: false, } @@ -2141,7 +2141,7 @@ impl Module { path: &mut Vec<&'a str>, variables: &mut StraightHashMap, functions: &mut StraightHashMap, - type_iterators: &mut StraightHashMap>, + type_iterators: &mut BTreeMap>, ) -> bool { let mut contains_indexed_global_functions = false; @@ -2205,7 +2205,7 @@ impl Module { let mut path = Vec::with_capacity(4); let mut variables = StraightHashMap::default(); let mut functions = StraightHashMap::default(); - let mut type_iterators = StraightHashMap::default(); + let mut type_iterators = BTreeMap::new(); path.push("");