- set key to key if direct match when inserting into red-black tree. fixes the issue when the key is a struct type, which is how treeset uses the red-black tree #31

pull/34/head
Emir Pasic 8 years ago
parent 62b6e90ed7
commit 196706bb29

@ -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:

Loading…
Cancel
Save