From 359855132a54c8c74261976f46aa803440051849 Mon Sep 17 00:00:00 2001 From: Theofrastos Mantadelis Date: Sat, 27 Nov 2010 16:34:18 +0100 Subject: [PATCH] Corrected a db trie related bug --- library/tries/core_dbtries.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/tries/core_dbtries.c b/library/tries/core_dbtries.c index 822adf24d..071c1b23e 100644 --- a/library/tries/core_dbtries.c +++ b/library/tries/core_dbtries.c @@ -612,8 +612,17 @@ TrNode core_breadth_reduction(TrEngine engine, TrNode node, TrNode breadth_node, } while (bucket != first_bucket); } else { do { - if (TrNode_entry(child) == PairEndTag) - return core_breadth_reduction(engine, child, breadth_node, opt_level, construct_function, destruct_function, copy_function, correct_order_function); + if (TrNode_entry(child) == PairEndTag) { + /* do breadth reduction simplification */ + node = TrNode_parent(child); + DATA_DESTRUCT_FUNCTION = destruct_function; + remove_child_nodes(TrNode_child(node)); + TrNode_child(node) = NULL; + node = trie_node_check_insert(node, PairEndTag); + INCREMENT_ENTRIES(CURRENT_TRIE_ENGINE); + return node; + //return core_breadth_reduction(engine, node, breadth_node, opt_level, construct_function, destruct_function, copy_function, correct_order_function); + } while (IS_FUNCTOR_NODE(child)) { child = TrNode_child(child); if (IS_HASH_NODE(child)) { // gets first child in the hash