mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-17 21:01:01 +00:00
Set parents correctly on split nodes
This commit is contained in:
parent
7c13dee33d
commit
096a403d52
1 changed files with 3 additions and 2 deletions
|
|
@ -119,8 +119,9 @@ func (s *SplitTree) Cleanup() {
|
|||
for i, node := range s.children {
|
||||
if n, ok := node.(*SplitTree); ok {
|
||||
if len(n.children) == 1 {
|
||||
if _, ok := n.children[0].(*LeafNode); ok {
|
||||
s.children[i] = n.children[0]
|
||||
if child, ok := n.children[0].(*LeafNode); ok {
|
||||
s.children[i] = child
|
||||
child.parent = s
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue