validation CHANGE checking list/leaflist duplicities
Optimize implementation and instead of comparing nodes to each other,
use hashtable to detect duplicities. To minimize memory consumption,
the hash tables are not stored permanently, but build when validating
the data tree.
diff --git a/src/validation.h b/src/validation.h
index a1e4583..bab2d12 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -52,6 +52,18 @@
int lyv_data_content(struct lyd_node *node, int options, struct unres_data *unres);
/**
+ * @brief check for list/leaflist uniqueness.
+ *
+ * Function is used by lyv_data_context for inner lists/leaflists. Due to optimization, the function
+ * is used separatedly for the top-level lists/leaflists.
+ *
+ * @param[in] node List/leaflist node to be checked.
+ * @param[in] start First sibling of the \p node for searching for other instances of the same list/leaflist.
+ * Used for optimization, but can be NULL and the first sibling will be found.
+ */
+int lyv_data_unique(struct lyd_node *node, struct lyd_node *start);
+
+/**
* @brief Validate if the \p node has a sibling from another choice's case. It can report an error or automatically
* remove the nodes from other case than \p node.
*