core: try to collapse traversed Billet part on errStop
This commit is contained in:
parent
360bb220b0
commit
495aba4174
1 changed files with 2 additions and 5 deletions
|
@ -258,7 +258,7 @@ func (b *Billet) traverse(curr Node, path, from []byte, process func(pathToNode
|
|||
return nil, err
|
||||
}
|
||||
n.Children[i] = r
|
||||
return n, err
|
||||
return b.tryCollapseBranch(n), err
|
||||
}
|
||||
n.Children[i] = r
|
||||
}
|
||||
|
@ -276,10 +276,7 @@ func (b *Billet) traverse(curr Node, path, from []byte, process func(pathToNode
|
|||
return nil, err
|
||||
}
|
||||
n.next = r
|
||||
if err != nil {
|
||||
return n, err
|
||||
}
|
||||
return b.tryCollapseExtension(n), nil
|
||||
return b.tryCollapseExtension(n), err
|
||||
default:
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue