From d3865633441f0e22626142a0f9fbfde0e9c2ef19 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 7 Oct 2021 21:23:37 +0100 Subject: Correct issue with the generated `map` type internals; Simplify map rehash logic to utilize `resize` --- src/check_type.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index 75fa503e5..0d5c0f977 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -2058,7 +2058,6 @@ void init_map_entry_type(Type *type) { // NOTE(bill): The preload types may have not been set yet GB_ASSERT(t_map_hash != nullptr); - Type *entry_type = alloc_type_struct(); /* struct { @@ -2076,7 +2075,7 @@ void init_map_entry_type(Type *type) { fields[2] = alloc_entity_field(s, make_token_ident(str_lit("key")), type->Map.key, false, 2, EntityState_Resolved); fields[3] = alloc_entity_field(s, make_token_ident(str_lit("value")), type->Map.value, false, 3, EntityState_Resolved); - + Type *entry_type = alloc_type_struct(); entry_type->Struct.fields = fields; entry_type->Struct.tags = gb_alloc_array(permanent_allocator(), String, fields.count); -- cgit v1.2.3