From bb1aa352aa6de1204afa4e289c725d6d0f24fa6f Mon Sep 17 00:00:00 2001 From: magical Date: Sun, 23 Jan 2022 01:34:34 +0000 Subject: [PATCH] switch to integer Keys and Values for fairer comparisons --- pmap.go | 4 ++-- pmap_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pmap.go b/pmap.go index 3785b9e..7510237 100644 --- a/pmap.go +++ b/pmap.go @@ -11,8 +11,8 @@ const ( nodeMask = 0b1111 ) -type Key = interface{} -type Value = interface{} +type Key = int +type Value = int type Map interface { Get(Key) (Value, bool) diff --git a/pmap_test.go b/pmap_test.go index 735ca4d..ca96b59 100644 --- a/pmap_test.go +++ b/pmap_test.go @@ -8,7 +8,7 @@ import ( func hash(k Key) uint32 { //u := uint(k.(int))*6364136223846793005 + 1 //return uint32(u >> 32) - u := uint(k.(int)) + u := uint(k) //u := uint(k.(int)) return uint32(u + u>>32) }