trees :: RBTreeMap :: insert_fixup_case4
this is a LRb or RLb conflict we rotate the tree to balance it
# Case 4: node and parent are red, uncle is black
# this is a LRb or RLb conflict
# we rotate the tree to balance it
private fun insert_fixup_case4(node: N) do
if node == node.parent.right and node.parent == node.grandparent.left then
rotate_left(node.parent.as(not null))
node = node.left.as(not null)
else if node == node.parent.left and node.parent == node.grandparent.right then
rotate_right(node.parent.as(not null))
node = node.right.as(not null)
end
insert_fixup_case5(node)
end
lib/trees/rbtree.nit:91,2--103,4