Mercurial > hg > GearsTemplate
changeset 74:724b65b1cfaf
modify deletion
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 10 Nov 2015 17:14:46 +0900 |
parents | 2667c3251a00 |
children | 97387904add9 |
files | src/llrb/llrb.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/llrb/llrb.c Tue Nov 10 10:21:37 2015 +0900 +++ b/src/llrb/llrb.c Tue Nov 10 17:14:46 2015 +0900 @@ -302,6 +302,8 @@ } __code replaceNode_d2(struct Context* context, struct Tree* tree) { + compare(context, tree, tree->current->key, context->data[Node]->node.key); + if (tree->result == 0 && tree->current->right == 0) { stack_pop(context->node_stack, &tree->current); @@ -367,7 +369,7 @@ __code moveRedLeft1(struct Context* context, struct Tree* tree, struct Node* node) { if (tree->current->right != 0) if (tree->current->right->left != 0) - if (tree->current->right->left == Red) { + if (tree->current->right->left->color == Red) { allocator(context); context->data[context->dataNum]->node = *node->right; node->right = &context->data[context->dataNum]->node; @@ -444,7 +446,7 @@ __code moveRedRight1(struct Context* context, struct Tree* tree, struct Node* node) { if (tree->current->left != 0) if (tree->current->left->left != 0) - if (tree->current->left->left == Red) { + if (tree->current->left->left->color == Red) { allocator(context); context->data[context->dataNum]->node = *node->left; node->left = &context->data[context->dataNum]->node; @@ -454,7 +456,7 @@ context->next = ColorFlip; stack_push(context->code_stack, &context->next); - + goto meta(context, RotateR); }