Simplify hashing approach map

This commit is contained in:
gingerBill
2020-11-29 15:50:29 +00:00
parent 97c66c9c73
commit 1dfe0cdd1d
6 changed files with 51 additions and 68 deletions
+3 -3
View File
@@ -2849,11 +2849,11 @@ void init_map_internal_types(Type *type) {
}
void add_map_key_type_dependencies(CheckerContext *ctx, Type *key) {
if (is_type_string(key)) {
add_package_dependency(ctx, "runtime", "default_hash_string");
if (is_type_cstring(key)) {
add_package_dependency(ctx, "runtime", "default_hasher_cstring");
} else if (is_type_string(key)) {
add_package_dependency(ctx, "runtime", "default_hasher_string");
} else if (!is_type_polymorphic(key)) {
add_package_dependency(ctx, "runtime", "default_hash_ptr");
GB_ASSERT_MSG(is_type_simple_compare(key), "%s", type_to_string(key));
i64 sz = type_size_of(key);