diff options
| author | gingerBill <bill@gingerbill.org> | 2022-12-20 14:59:00 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-12-20 14:59:00 +0000 |
| commit | 3040361faca44fd8b1c8a5a7bb86c73a1c46e08f (patch) | |
| tree | 948383be1ccbb1037935b10c325b5ef95cb6b567 /src/types.cpp | |
| parent | 44caa96d50574131e3615958eedc881e68c90905 (diff) | |
Correct `type_ptr_set_update` and `type_ptr_set_exists`
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 890098ad0..c113525d6 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -816,6 +816,14 @@ gb_internal bool type_ptr_set_update(PtrSet<Type *> *s, Type *t) { if (ptr_set_exists(s, t)) { return true; } + ptr_set_add(s, t); + return false; +} + +gb_internal bool type_ptr_set_exists(PtrSet<Type *> *s, Type *t) { + if (ptr_set_exists(s, t)) { + return true; + } // TODO(bill, 2019-10-05): This is very slow and it's probably a lot // faster to cache types correctly |