Minor code refactor.

This commit is contained in:
Stephen Chung
2022-11-20 19:12:29 +08:00
parent f7c8238613
commit 56631b1b66
4 changed files with 495 additions and 520 deletions

View File

@@ -23,18 +23,14 @@ impl Engine {
let root = namespace.root();
let index = if global.always_search_scope {
None
} else {
namespace.index()
};
// Qualified - check if the root module is directly indexed
if let Some(index) = index {
let offset = global.num_imports() - index.get();
if !global.always_search_scope {
if let Some(index) = namespace.index() {
let offset = global.num_imports() - index.get();
if let m @ Some(_) = global.get_shared_import(offset) {
return m;
if let m @ Some(_) = global.get_shared_import(offset) {
return m;
}
}
}