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
+6 -2
View File
@@ -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);
}
};