From 6de290647da924baae2979e3ba766b20125e98fa Mon Sep 17 00:00:00 2001 From: magical Date: Sun, 23 Jan 2022 02:59:35 +0000 Subject: [PATCH] remove shift argument from insert --- pmap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmap.go b/pmap.go index 109c893..4a105c5 100644 --- a/pmap.go +++ b/pmap.go @@ -64,7 +64,7 @@ func (p pmap) Get(k Key) (Value, bool) { func (p pmap) Set(k Key, v Value) Map { h := p.hash(k) - root, added := insert(p.root, 0, h, k, v, hash) + root, added := insert(p.root, h, k, v, hash) p.root = root if added { p.len++ @@ -129,7 +129,7 @@ func newnode(child interface{}, hash, shift uint32) *node { return n } -func insert(n interface{}, shift, hash uint32, key Key, val Value, hashFn HashFunc) (newNode interface{}, added bool) { +func insert(n interface{}, hash uint32, key Key, val Value, hashFn HashFunc) (newNode interface{}, added bool) { if n == nil { return leaf{key, val}, true } @@ -197,7 +197,7 @@ func insert(n interface{}, shift, hash uint32, key Key, val Value, hashFn HashFu panic("pmap: unhandled case in insert") } } - newNode = _insert(n, shift) + newNode = _insert(n, 0) return }