diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2021-11-05 18:12:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-05 18:12:40 +0000 |
| commit | ee259e42298eca0e4e5d6b8681c2403c3bf7a80e (patch) | |
| tree | 7bfd15490ddc4be6fcd41b4f969df6c901d98f76 /src/check_type.cpp | |
| parent | e963fc4d6a2b8fc63f46bb57b2c727999ce39e29 (diff) | |
| parent | 36985f8da0cea59cb1912f62ae4e700983159b6a (diff) | |
Merge pull request #1273 from odin-lang/compiler-map-improvements
Compiler Map Improvements
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 05d5c674a..398967af8 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -228,7 +228,7 @@ Entity *find_polymorphic_record_entity(CheckerContext *ctx, Type *original_type, mutex_lock(&ctx->info->gen_types_mutex); defer (mutex_unlock(&ctx->info->gen_types_mutex)); - auto *found_gen_types = map_get(&ctx->info->gen_types, hash_pointer(original_type)); + auto *found_gen_types = map_get(&ctx->info->gen_types, original_type); if (found_gen_types != nullptr) { // GB_ASSERT_MSG(ordered_operands.count >= param_count, "%td >= %td", ordered_operands.count, param_count); @@ -311,13 +311,13 @@ void add_polymorphic_record_entity(CheckerContext *ctx, Ast *node, Type *named_t named_type->Named.type_name = e; mutex_lock(&ctx->info->gen_types_mutex); - auto *found_gen_types = map_get(&ctx->info->gen_types, hash_pointer(original_type)); + auto *found_gen_types = map_get(&ctx->info->gen_types, original_type); if (found_gen_types) { array_add(found_gen_types, e); } else { auto array = array_make<Entity *>(heap_allocator()); array_add(&array, e); - map_set(&ctx->info->gen_types, hash_pointer(original_type), array); + map_set(&ctx->info->gen_types, original_type, array); } mutex_unlock(&ctx->info->gen_types_mutex); } |