From 549413b48b1b18682bb246284323a768e1fb3c6b Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Fri, 4 Oct 2019 23:12:16 +1000 Subject: [PATCH] compiler: no more mem error, so recycle import table struct --- compiler/table.v | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/table.v b/compiler/table.v index ca5a0b47fc..f675f89c37 100644 --- a/compiler/table.v +++ b/compiler/table.v @@ -872,15 +872,10 @@ fn (table &Table) qualify_module(mod string, file_path string) string { } fn (table &Table) get_file_import_table(id string) FileImportTable { - // if file_path.clone() in table.file_imports { - // return table.file_imports[file_path.clone()] - // } - // just get imports. memory error when recycling import table - mut fit := new_file_import_table(id) if id in table.file_imports { - fit.imports = table.file_imports[id].imports + return table.file_imports[id] } - return fit + return new_file_import_table(id) } fn new_file_import_table(file_path string) FileImportTable {