This commit is contained in:
Alexander Neumann
2015-02-15 14:44:54 +01:00
parent 2f1137bac4
commit f8f8107d55
8 changed files with 171 additions and 59 deletions

View File

@@ -183,8 +183,7 @@ func (t *Tree) Insert(node *Node) error {
return ErrNodeAlreadyInTree
}
// insert blob
// https://code.google.com/p/go-wiki/wiki/bliceTricks
// https://code.google.com/p/go-wiki/wiki/SliceTricks
t.Nodes = append(t.Nodes, &Node{})
copy(t.Nodes[pos+1:], t.Nodes[pos:])
t.Nodes[pos] = node