Mercurial > hg > Members > innparusu > Gears
changeset 128:32773f506410
remove code stack, add continuation of rotateL/totateR
author | ikkun |
---|---|
date | Mon, 26 Sep 2016 19:54:24 +0900 |
parents | a574ba0da60f |
children | b224aa7b80a0 |
files | src/parallel_execution/rb_tree.c |
diffstat | 1 files changed, 5 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/rb_tree.c Wed Sep 14 20:43:37 2016 +0900 +++ b/src/parallel_execution/rb_tree.c Mon Sep 26 19:54:24 2016 +0900 @@ -170,14 +170,10 @@ traverse->current = parent; if ((current == parent->right) && (parent == grandparent->left)) { - context->next = InsertCase4_1; - - stack_push(context->code_stack, &context->next); + traverse->next = InsertCase4_1; goto meta(context, RotateL); } else if ((current == parent->left) && (parent == grandparent->right)) { - context->next = InsertCase4_2; - - stack_push(context->code_stack, &context->next); + traverse->next = InsertCase4_2; goto meta(context, RotateR); } @@ -221,7 +217,7 @@ grandparent->color = Red; traverse->current = grandparent; - + traverse->next = context->next; if ((current == parent->left) && (parent == grandparent->left)) goto meta(context, RotateR); else @@ -255,8 +251,7 @@ tmp->left = node; traverse->current = tmp; - stack_pop(context->code_stack, &context->next); - goto meta(context, context->next); + goto meta(context, traverse->next); } __code rotateLeft_stub(struct Context* context) { @@ -287,8 +282,7 @@ tmp->right = node; traverse->current = tmp; - stack_pop(context->code_stack, &context->next); - goto meta(context, context->next); + goto meta(context, traverse->next); } __code rotateRight_stub(struct Context* context) {