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

@@ -956,7 +956,11 @@ impl Engine {
ast: AST,
optimization_level: OptimizationLevel,
) -> AST {
let fn_lib = ast.1.iter().map(|fn_def| fn_def.as_ref().clone()).collect();
let fn_lib = ast
.1
.iter()
.map(|(_, fn_def)| fn_def.as_ref().clone())
.collect();
optimize_into_ast(self, scope, ast.0, fn_lib, optimization_level)
}