Make FunctionsLib a HashMap.

This commit is contained in:
Stephen Chung
2020-04-16 23:58:57 +08:00
parent f8e9d66a0b
commit 3a93ab8240
4 changed files with 45 additions and 62 deletions

View File

@@ -397,13 +397,6 @@ impl<'a> Scope<'a> {
&mut entry.value
}
/// Get a mutable reference to an entry in the Scope and downcast it to a specific type
pub(crate) fn get_mut_by_type<T: Variant + Clone>(&mut self, key: EntryRef) -> &mut T {
self.get_mut(key)
.downcast_mut::<T>()
.expect("wrong type cast")
}
/// Get an iterator to entries in the Scope.
pub fn iter(&self) -> impl Iterator<Item = &Entry> {
self.0.iter().rev() // Always search a Scope in reverse order