int which_child = AVL_XCHILD(node);
int child_bal = AVL_XBALANCE(child);
- /* BEGIN CSTYLED */
/*
* case 1 : node is overly left heavy, the left child is balanced or
* also left heavy. This requires the following rotation.
* we detect this situation by noting that child's balance is not
* right_heavy.
*/
- /* END CSTYLED */
if (child_bal != right_heavy) {
/*
return (child_bal == 0);
}
- /* BEGIN CSTYLED */
/*
* case 2 : When node is left heavy, but child is right heavy we use
* a different rotation.
* if gchild was right_heavy, then child is now left heavy
* else it is balanced
*/
- /* END CSTYLED */
gchild = child->avl_child[right];
gleft = gchild->avl_child[left];
gright = gchild->avl_child[right];