From 6e26728391a7cc73f8c7a4a1587898bbf6887529 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 20 Jan 2020 15:56:34 +0100 Subject: [PATCH] compiler: remove some dead code --- compiler/map.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/compiler/map.go b/compiler/map.go index 9a5f23fa..e4998d4b 100644 --- a/compiler/map.go +++ b/compiler/map.go @@ -152,28 +152,6 @@ func (c *Compiler) emitMapDelete(keyType types.Type, m, key llvm.Value, pos toke } } -// Get FNV-1a hash of this string. -// -// https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash -func hashmapHash(data []byte) uint32 { - var result uint32 = 2166136261 // FNV offset basis - for _, c := range data { - result ^= uint32(c) - result *= 16777619 // FNV prime - } - return result -} - -// Get the topmost 8 bits of the hash, without using a special value (like 0). -func hashmapTopHash(hash uint32) uint8 { - tophash := uint8(hash >> 24) - if tophash < 1 { - // 0 means empty slot, so make it bigger. - tophash += 1 - } - return tophash -} - // Returns true if this key type does not contain strings, interfaces etc., so // can be compared with runtime.memequal. func hashmapIsBinaryKey(keyType types.Type) bool {