aboutsummaryrefslogtreecommitdiff
path: root/src/docs_writer.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-06-02 10:39:47 +0100
committergingerBill <bill@gingerbill.org>2021-06-02 10:39:47 +0100
commit91b4bf3daa026c9ce14c520c5e4a8a2b9141c485 (patch)
treef3a367393c5aecef5ed27a6c08170f1b34ebdbf1 /src/docs_writer.cpp
parent8c943eb054d6c641996920e73065a35178ba2a2d (diff)
Minor clean up
Diffstat (limited to 'src/docs_writer.cpp')
-rw-r--r--src/docs_writer.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp
index 03ea25930..3c6c29b0d 100644
--- a/src/docs_writer.cpp
+++ b/src/docs_writer.cpp
@@ -265,11 +265,8 @@ 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) {
- String file_path = get_file_path_string(pos.file_id);
- if (file_path != "") {
- AstFile **found = string_map_get(&w->info->files, file_path);
- GB_ASSERT(found != nullptr);
- AstFile *file = *found;
+ AstFile *file = get_ast_file_from_id(pos.file_id);
+ if (file != nullptr) {
OdinDocFileIndex *file_index_found = map_get(&w->file_cache, hash_pointer(file));
GB_ASSERT(file_index_found != nullptr);
file_index = *file_index_found;