Minor refactor.

This commit is contained in:
Stephen Chung
2022-03-27 21:53:50 +08:00
parent 5caf20d26b
commit 6369fa5c65
5 changed files with 10 additions and 11 deletions

View File

@@ -227,9 +227,9 @@ impl Engine {
ast.as_ref(),
];
let lib = if lib.first().map(|m: &&Module| m.is_empty()).unwrap_or(true) {
&lib[0..0]
&[]
} else {
&lib
&lib[..]
};
self.eval_global_statements(scope, global, &mut state, statements, lib, level)
}