Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Jan 10, 2023
1 parent a86c2f3 commit fc7bcdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion treap.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ func (t Tree[T]) Insert(items ...T) Tree[T] {
for i := range items {
n = n.insert(makeNode(items[i]), immutable)
}
return Tree[T]{root: n}

t.root = n
return t
}

// insert into tree, changing nodes are copied, new treap is returned, old treap is modified if immutable is false.
Expand Down

0 comments on commit fc7bcdc

Please sign in to comment.