199 } else { |
199 } else { |
200 if (p) { |
200 if (p) { |
201 ucx_avl_connect(tree, p, n->right ? n->right:n->left, n->key); |
201 ucx_avl_connect(tree, p, n->right ? n->right:n->left, n->key); |
202 } else { |
202 } else { |
203 tree->root = n->right ? n->right : n->left; |
203 tree->root = n->right ? n->right : n->left; |
204 if(tree->root) { |
204 if (tree->root) { |
205 tree->root->parent = NULL; |
205 tree->root->parent = NULL; |
206 } |
206 } |
207 } |
207 } |
208 alfree(tree->allocator, n); |
208 alfree(tree->allocator, n); |
209 } |
209 } |