Improve usage of file_id

This commit is contained in:
gingerBill
2021-11-15 17:26:01 +00:00
parent f55fc4cd08
commit e814a3693f
9 changed files with 75 additions and 30 deletions

View File

@@ -257,7 +257,7 @@ OdinDocArray<T> odin_write_item_as_slice(OdinDocWriter *w, T data) {
OdinDocPosition odin_doc_token_pos_cast(OdinDocWriter *w, TokenPos const &pos) {
OdinDocFileIndex file_index = 0;
if (pos.file_id != 0) {
AstFile *file = get_ast_file_from_id(pos.file_id);
AstFile *file = global_files[pos.file_id];
if (file != nullptr) {
OdinDocFileIndex *file_index_found = map_get(&w->file_cache, file);
GB_ASSERT(file_index_found != nullptr);