diff options
author | John Estabrook <jestabro@vyos.io> | 2023-05-16 12:47:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 12:47:05 -0500 |
commit | cd4d75828efc51f42a53966ad7d85e4f0500b089 (patch) | |
tree | c2eee56088494501dc8a938a60eb8f61207e5181 /src/vytree.ml | |
parent | ceed15b2b064b36c0f49d2142ebe0dafeaa34267 (diff) | |
parent | ea2105a95dc1d821a933a6a441f5efc39779a624 (diff) | |
download | vyos1x-config-cd4d75828efc51f42a53966ad7d85e4f0500b089.tar.gz vyos1x-config-cd4d75828efc51f42a53966ad7d85e4f0500b089.zip |
Merge pull request #17 from jestabro/reference-tree
T5194: add support for reference tree
Diffstat (limited to 'src/vytree.ml')
-rw-r--r-- | src/vytree.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vytree.ml b/src/vytree.ml index bd73776..ace587b 100644 --- a/src/vytree.ml +++ b/src/vytree.ml @@ -88,6 +88,10 @@ let rec insert ?(position=Default) ?(children=[]) node path data = let s = Printf.sprintf "Non-existent intermediary node: \'%s\'" name in raise (Insert_error s) +let insert_maybe ?(position=Default) node path data = + try insert ~position:position node path data + with Duplicate_child -> node + let sorted_children_of_node cmp node = let names = list_children node in let names = List.sort cmp names in |