Skip to content

Commit

Permalink
Merge pull request #34 from emirpasic/rbt_fix_struct_key
Browse files Browse the repository at this point in the history
Fix duplicate struct key insertion in red-black tree
  • Loading branch information
emirpasic authored Sep 7, 2016
2 parents 62b6e90 + 196706b commit 549b638
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions trees/redblacktree/redblacktree.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (tree *Tree) Put(key interface{}, value interface{}) {
compare := tree.Comparator(key, node.Key)
switch {
case compare == 0:
node.Key = key
node.Value = value
return
case compare < 0:
Expand Down

0 comments on commit 549b638

Please sign in to comment.