Use hashed lookup for module-qualified functions and variables.

This commit is contained in:
Stephen Chung
2020-05-08 00:19:08 +08:00
parent 7f6ce29447
commit 5f12391ec6
8 changed files with 268 additions and 121 deletions

View File

@@ -175,7 +175,9 @@ impl<'a> Scope<'a> {
///
/// Modules are used for accessing member variables, functions and plugins under a namespace.
#[cfg(not(feature = "no_module"))]
pub fn push_module<K: Into<Cow<'a, str>>>(&mut self, name: K, value: Module) {
pub fn push_module<K: Into<Cow<'a, str>>>(&mut self, name: K, mut value: Module) {
value.collect_all_sub_modules();
self.push_dynamic_value(
name,
EntryType::Module,