diff options
author | Daniil Baturin <daniil@baturin.org> | 2015-02-01 22:15:47 +0600 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2015-02-01 22:15:47 +0600 |
commit | 27e59f8810f305fdb61c4a1e702e5ccb2fe25c68 (patch) | |
tree | 04bf16bc23bc896b6b327f677628a10c1f911cdc | |
parent | 62dc6df905b53435340dcbacefc26ae72c518d57 (diff) | |
download | vyconf-27e59f8810f305fdb61c4a1e702e5ccb2fe25c68.tar.gz vyconf-27e59f8810f305fdb61c4a1e702e5ccb2fe25c68.zip |
Use adopt_child instead of reconstructing the node by hand.
-rw-r--r-- | src/vyconf_tree.ml | 3 |
1 files changed, 1 insertions, 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 |