1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: clean up get_file_import_table

This commit is contained in:
joe-conigliaro 2019-09-23 22:12:23 +10:00 committed by Alexander Medvednikov
parent 422ba3a3ce
commit fbc19311b5

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
}