remove shift argument from lookup

master
magical 2022-01-23 05:37:42 +00:00
parent 0ef57e0865
commit a67e1d12db
1 changed files with 3 additions and 2 deletions

View File

@ -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) {