tools/oxenstored: Backport find_opt/update from 4.06
authorEdwin Török <edvin.torok@citrix.com>
Fri, 8 Jan 2021 11:57:37 +0000 (11:57 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 22 Jan 2021 18:01:34 +0000 (18:01 +0000)
commitfaf02c345ec0b2a5bbd45b4f94ffd59e75a42435
tree541b4beb780aa161e2efb6fee1a0b7a1c387ab4c
parent5e115dcf76f61543fb734baf4a60fc1902398113
tools/oxenstored: Backport find_opt/update from 4.06

We are currently on OCaml 4.02 as minimum version.  To make the followup
optimizations compile backport these functions from OCaml 4.06.

This implementation is less efficient than the one in the 4.06 standard
library which has access to the internals of the Map.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/xenstored/stdext.ml
tools/ocaml/xenstored/trie.ml