changeset 60:4e5b425922ce

fix llrb
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Tue, 16 Jun 2015 17:13:04 +0900
parents 8c709b714fb0
children e18baa87cf49
files src/llrb/llrb.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/llrb/llrb.c	Tue Jun 16 13:40:26 2015 +0900
+++ b/src/llrb/llrb.c	Tue Jun 16 17:13:04 2015 +0900
@@ -98,8 +98,8 @@
     if (tree->root == 0) {
         context->next[context->current++] = Insert;
     } else {
+        context->next[context->current++] = Replace;
         context->next[context->current++] = Compare;
-        context->next[context->current++] = Replace;
         tree->current = tree->root;
     }
     goto meta(context, Allocator);
@@ -129,8 +129,8 @@
         stack_pop(pstack, &tree->current);
         context->next[context->current++] = Insert;
     } else {
+        context->next[context->current++] = Replace;
         context->next[context->current++] = Compare;
-        context->next[context->current++] = Replace;
     }
 
     goto meta(context, Allocator);
@@ -298,14 +298,12 @@
     puts("---before---");
     print_tree(context->data[Tree]->tree.root, 0);
     
-    struct Allocate* allocate = &context->data[Allocate]->allocate;
-    allocate->size = sizeof(struct Node);
-    allocate->next = Code5;
-
     struct Node* node = &context->data[Node]->node;
     node->key = 0;
     node->value = 0;
     
+    context->next[context->current++] = Code5;
+
     goto meta(context, Put);
 }