From f09b6a4c90805a562b2252430f844e85d06f1ee1 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 13 Apr 2020 13:02:30 +0100 Subject: Simplify compiler's `Map` and create a `StringMap` specifically for strings --- src/exact_value.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/exact_value.cpp') diff --git a/src/exact_value.cpp b/src/exact_value.cpp index f4d2e60de..1473319cc 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -69,7 +69,10 @@ HashKey hash_exact_value(ExactValue v) { case ExactValue_Bool: return hash_integer(u64(v.value_bool)); case ExactValue_String: - return hash_string(v.value_string); + { + char const *str = string_intern(v.value_string); + return hash_pointer(str); + } case ExactValue_Integer: { HashKey key = hashing_proc(big_int_ptr(&v.value_integer), v.value_integer.len * gb_size_of(u64)); -- cgit v1.2.3