compiler: clean up get_file_import_table

pull/2086/head
joe-conigliaro 2019-09-23 22:12:23 +10:00 committed by Alexander Medvednikov
parent 422ba3a3ce
commit fbc19311b5
1 changed files with 2 additions and 4 deletions

View File

@ -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
}