diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-22 14:39:34 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-22 14:39:34 +0100 |
commit | a608b90f8c146430803871e20d043b60a278248b (patch) | |
tree | 194e6e80cd5403cc64d1e4915f9be45a462d3918 /trie.c.inc | |
parent | strbuf (diff) | |
download | calp-a608b90f8c146430803871e20d043b60a278248b.tar.gz calp-a608b90f8c146430803871e20d043b60a278248b.tar.xz |
rest
Diffstat (limited to 'trie.c.inc')
-rw-r--r-- | trie.c.inc | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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> |