# HG changeset patch # User Shohei KOKUBO # Date 1447143286 -32400 # Node ID 724b65b1cfaf13f528db2945001b3d2ff5d7a7a4 # Parent 2667c3251a0072f8d202c38be08fc05f5aed3b5a modify deletion diff -r 2667c3251a00 -r 724b65b1cfaf src/llrb/llrb.c --- 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); }