aboutsummaryrefslogtreecommitdiff
path: root/trie.c.inc
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-22 14:39:34 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-02-22 14:39:34 +0100
commita608b90f8c146430803871e20d043b60a278248b (patch)
tree194e6e80cd5403cc64d1e4915f9be45a462d3918 /trie.c.inc
parentstrbuf (diff)
downloadcalp-a608b90f8c146430803871e20d043b60a278248b.tar.gz
calp-a608b90f8c146430803871e20d043b60a278248b.tar.xz
rest
Diffstat (limited to 'trie.c.inc')
-rw-r--r--trie.c.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/trie.c.inc b/trie.c.inc
index 3c98c6cd..34e3a283 100644
--- a/trie.c.inc
+++ b/trie.c.inc
@@ -59,7 +59,8 @@ int trie<T>::push (char* key, T* val) {
last->child = t;
last = t;
}
- last->value = RESOLVE(TYPE)(last->value, val);
+ // last->value = RESOLVE(TYPE)(last->value, val);
+ last->value = last->value->resolve(val);
return 0;
} else if (cur->c == subkey[0]) {
/* This node belongs to the key,
@@ -69,7 +70,8 @@ int trie<T>::push (char* key, T* val) {
subkey++;
} else if (subkey[0] == '\0') {
/* Key finished */
- last->value = RESOLVE(TYPE)(last->value, val);
+ // last->value = RESOLVE(TYPE)(last->value, val);
+ last->value->resolve(val);
return 0;
} else if (cur->next != NULL) {
/* This node was not part of the set, but it's sibling might */
@@ -132,7 +134,8 @@ trie<T>::~trie () {
// return 1;
return; // error
}
- free (this->root);
+ // free (this->root);
+ delete this->root;
}
template <class T>