Browse Source

ensure that a grandparent exists when it is involved in the ballance

1.0.2
Georg Hopp 11 years ago
parent
commit
db5f9d43f7
  1. 2
      include/tr/tree_macros.h

2
include/tr/tree_macros.h

@ -267,9 +267,11 @@ typedef enum {rbBlack=1, rbRed=2} TR_rbColor;
while (1) { \
TR_TREE_BALANCE_INSERT_CASE1((node)) \
TR_TREE_BALANCE_INSERT_CASE2((node)) \
if (NULL != (node)->parent->parent) { \
TR_TREE_BALANCE_INSERT_CASE3((node)) \
TR_TREE_BALANCE_INSERT_CASE4((root), (node)) \
TR_TREE_BALANCE_INSERT_CASE5((root), (node)) \
} \
break; \
}

Loading…
Cancel
Save