From e814a3693f9efbdd00113de4dd5937acd97bc486 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 15 Nov 2021 17:26:01 +0000 Subject: Improve usage of `file_id` --- src/parser.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/parser.hpp') diff --git a/src/parser.hpp b/src/parser.hpp index b1518533e..b83822cbf 100644 --- a/src/parser.hpp +++ b/src/parser.hpp @@ -731,8 +731,12 @@ struct Ast { // NOTE(bill): I know I dislike methods but this is hopefully a temporary thing // for refactoring purposes - AstFile *file() const { - return get_ast_file_from_id(this->file_id); + gb_inline AstFile *file() const { + // NOTE(bill): This doesn't need to call get_ast_file_from_id which + return global_files[this->file_id]; + } + gb_inline AstFile *thread_safe_file() const { + return thread_safe_get_ast_file_from_id(this->file_id); } }; -- cgit v1.2.3