diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/containers/rbtree.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/containers/rbtree.go b/lib/containers/rbtree.go index f922a7b..0430123 100644 --- a/lib/containers/rbtree.go +++ b/lib/containers/rbtree.go @@ -391,10 +391,10 @@ func (t *RBTree[K, V]) Insert(val V) { t.root.Color = Black } -func (t *RBTree[K, V]) transplant(old, new *RBNode[V]) { - *t.parentChild(old) = new - if new != nil { - new.Parent = old.Parent +func (t *RBTree[K, V]) transplant(oldNode, newNode *RBNode[V]) { + *t.parentChild(oldNode) = newNode + if newNode != nil { + newNode.Parent = oldNode.Parent } } |