From fbc19311b55ae8e3090ea98deab6bb6157581646 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Mon, 23 Sep 2019 22:12:23 +1000 Subject: [PATCH] compiler: clean up get_file_import_table --- compiler/table.v | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/table.v b/compiler/table.v index f3b83da741..3ceee1aca9 100644 --- a/compiler/table.v +++ b/compiler/table.v @@ -835,12 +835,10 @@ fn (table &Table) get_file_import_table(file_path string) FileImportTable { // return table.file_imports[file_path.clone()] // } // just get imports. memory error when recycling import table - mut imports := map[string]string + mut fit := new_file_import_table(file_path) if file_path in table.file_imports { - imports = table.file_imports[file_path].imports + fit.imports = table.file_imports[file_path].imports } - mut fit := new_file_import_table(file_path.clone()) - fit.imports = imports return fit }