diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-04-27 09:03:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-27 09:03:05 +0100 |
| commit | 5969796fbfaa62ea6aba8f0e3915ab8282bb71b5 (patch) | |
| tree | 55775ab838d39df7b127c3e003b16ca4a59a0d0a /src/check_expr.cpp | |
| parent | 9d3f835e31c08f40dfd420806942af2b7042f993 (diff) | |
| parent | 652079476489b2539c77824ec2719847f28c352d (diff) | |
Merge pull request #3490 from odin-lang/new-string-map
Change layout of compiler hash map types
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index b893b3a00..06d0a8b12 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8079,11 +8079,10 @@ gb_internal void add_constant_switch_case(CheckerContext *ctx, SeenMap *seen, Op } uintptr key = hash_exact_value(operand.value); - TypeAndToken *found = map_get(seen, key); - if (found != nullptr) { + GB_ASSERT(key != 0); + isize count = multi_map_count(seen, key); + if (count) { TEMPORARY_ALLOCATOR_GUARD(); - - isize count = multi_map_count(seen, key); TypeAndToken *taps = gb_alloc_array(temporary_allocator(), TypeAndToken, count); multi_map_get_all(seen, key, taps); @@ -9406,7 +9405,8 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast * continue; } ExactValue v = f->Constant.value; - auto found = map_get(&seen, hash_exact_value(v)); + uintptr hash = hash_exact_value(v); + auto found = map_get(&seen, hash); if (!found) { array_add(&unhandled, f); } |