Simplify code by merging Engine::global_namespace with Engine::global_modules.
This commit is contained in:
@@ -198,12 +198,6 @@ impl Engine {
|
||||
source: m.id_raw().cloned(),
|
||||
})
|
||||
})
|
||||
.or_else(|| {
|
||||
self.global_namespace
|
||||
.get_fn(hash)
|
||||
.cloned()
|
||||
.map(|func| FnResolutionCacheEntry { func, source: None })
|
||||
})
|
||||
.or_else(|| {
|
||||
self.global_modules.iter().find_map(|m| {
|
||||
m.get_fn(hash).cloned().map(|func| FnResolutionCacheEntry {
|
||||
@@ -619,8 +613,6 @@ impl Engine {
|
||||
|
||||
// First check script-defined functions
|
||||
let result = lib.iter().any(|&m| m.contains_fn(hash_script))
|
||||
// Then check registered functions
|
||||
|| self.global_namespace.contains_fn(hash_script)
|
||||
// Then check packages
|
||||
|| self.global_modules.iter().any(|m| m.contains_fn(hash_script))
|
||||
// Then check imported modules
|
||||
|
Reference in New Issue
Block a user