diff options
| author | gingerBill <bill@gingerbill.org> | 2024-04-26 15:04:46 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-04-26 15:04:46 +0100 |
| commit | 2b26384b89ed2b29f9d7db13f73c52029a2a2341 (patch) | |
| tree | 717b4d630ec3044107dc970b286c5ff94e014657 /src/checker.cpp | |
| parent | c685b404ea9cc9807b6d8cfc6f2a119924a79b4f (diff) | |
Implement dumb `PtrMap`
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 3b51cc6e0..64fca0312 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1897,8 +1897,7 @@ gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) { add_type_info_dependency(c->info, c->decl, t); MUTEX_GUARD_BLOCK(&c->info->type_info_mutex) { - MapFindResult fr; - auto found = map_try_get(&c->info->type_info_map, t, &fr); + auto found = map_get(&c->info->type_info_map, t); if (found != nullptr) { // Types have already been added return; @@ -1922,7 +1921,7 @@ gb_internal void add_type_info_type_internal(CheckerContext *c, Type *t) { ti_index = c->info->type_info_types.count; array_add(&c->info->type_info_types, t); } - map_set_internal_from_try_get(&c->checker->info.type_info_map, t, ti_index, fr); + map_set(&c->checker->info.type_info_map, t, ti_index); if (prev) { // NOTE(bill): If a previous one exists already, no need to continue |