tree_data OPTIMIZE don't check dups on htable insertion
When inserting a node into the children hash table, we check that
it was not already added, using a pointer comparison.
This check can take a lot of time if there are a lot of collisions
in the hash table, which is the case for keyless lists.
Use the new API lyht_insert_no_check() to optimize the insertion.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
diff --git a/src/tree_data_hash.c b/src/tree_data_hash.c
index c8ea2f2..65ece95 100644
--- a/src/tree_data_hash.c
+++ b/src/tree_data_hash.c
@@ -128,7 +128,7 @@
assert(ht && node && node->schema);
/* add node itself */
- if (lyht_insert(ht, &node, node->hash, NULL)) {
+ if (lyht_insert_no_check(ht, &node, node->hash, NULL)) {
LOGINT_RET(LYD_CTX(node));
}