Skip to content

Commit

Permalink
- fix #85
Browse files Browse the repository at this point in the history
  • Loading branch information
emirpasic committed Sep 20, 2018
1 parent 17852f4 commit 370f7ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trees/redblacktree/redblacktree.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func NewWithStringComparator() *Tree {
func (tree *Tree) Put(key interface{}, value interface{}) {
var insertedNode *Node
if tree.Root == nil {
// Assert key is of comparator's type for initial tree
tree.Comparator(key, key)
tree.Root = &Node{Key: key, Value: value, color: red}
insertedNode = tree.Root
} else {
Expand Down

0 comments on commit 370f7ab

Please sign in to comment.