remove shift argument from lookup
parent
0ef57e0865
commit
a67e1d12db
5
pmap.go
5
pmap.go
|
@ -67,7 +67,7 @@ func (p pmap) Len() int {
|
|||
func (p pmap) Get(k Key) (Value, bool) {
|
||||
var zero Value
|
||||
h := p.hash(k)
|
||||
return lookup(p.root, 0, h, k, zero)
|
||||
return lookup(p.root, h, k, zero)
|
||||
}
|
||||
|
||||
func (p pmap) Set(k Key, v Value) Map {
|
||||
|
@ -112,7 +112,8 @@ func (n collision) getNode(hash uint32, key Key) interface{} {
|
|||
return nil
|
||||
}
|
||||
|
||||
func lookup(root interface{}, shift, hash uint32, key Key, zero Value) (Value, bool) {
|
||||
func lookup(root interface{}, hash uint32, key Key, zero Value) (Value, bool) {
|
||||
shift := 0
|
||||
cur := root
|
||||
for {
|
||||
switch n := cur.(type) {
|
||||
|
|
Loading…
Reference in New Issue