From 27e59f8810f305fdb61c4a1e702e5ccb2fe25c68 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 1 Feb 2015 22:15:47 +0600 Subject: Use adopt_child instead of reconstructing the node by hand. --- src/vyconf_tree.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vyconf_tree.ml b/src/vyconf_tree.ml index 546498e..449f095 100644 --- a/src/vyconf_tree.ml +++ b/src/vyconf_tree.ml @@ -58,5 +58,4 @@ let rec insert_child default_data node path data = | None -> let next_child' = Node (name, default_data, []) in let new_node = insert_child default_data next_child' names data in - let (old_name, old_data, old_children) = destructure_node node in - Node (old_name, old_data, new_node :: old_children) + adopt_child node new_node -- cgit v1.2.3