remove shift argument from insert
parent
9553b9a9e4
commit
6de290647d
6
pmap.go
6
pmap.go
|
@ -64,7 +64,7 @@ func (p pmap) Get(k Key) (Value, bool) {
|
||||||
|
|
||||||
func (p pmap) Set(k Key, v Value) Map {
|
func (p pmap) Set(k Key, v Value) Map {
|
||||||
h := p.hash(k)
|
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
|
p.root = root
|
||||||
if added {
|
if added {
|
||||||
p.len++
|
p.len++
|
||||||
|
@ -129,7 +129,7 @@ func newnode(child interface{}, hash, shift uint32) *node {
|
||||||
return n
|
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 {
|
if n == nil {
|
||||||
return leaf{key, val}, true
|
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")
|
panic("pmap: unhandled case in insert")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newNode = _insert(n, shift)
|
newNode = _insert(n, 0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue