From 096a403d52fb0b1d7f5834b65131cb60580c6b4b Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Thu, 11 Aug 2016 16:59:06 -0400 Subject: [PATCH] Set parents correctly on split nodes --- cmd/micro/split_tree.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/micro/split_tree.go b/cmd/micro/split_tree.go index fed4490c..b1656372 100644 --- a/cmd/micro/split_tree.go +++ b/cmd/micro/split_tree.go @@ -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 } }