The unified diff between revisions [c0298de2..] and [fac83dcc..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'viz_misc.ml'

#
#
# patch "viz_misc.ml"
#  from [6fd0c3f159b19117f0baf4570c3cec8b0a24aedc]
#    to [962f45ead1ad16c50548c9a69a360d70940d195e]
#
============================================================
--- viz_misc.ml	6fd0c3f159b19117f0baf4570c3cec8b0a24aedc
+++ viz_misc.ml	962f45ead1ad16c50548c9a69a360d70940d195e
@@ -57,6 +57,14 @@ let rec list_rassoc v = function
   | _ :: tl -> list_rassoc v tl
   | [] -> raise Not_found

+let list_filter_map p f l =
+  List.fold_left
+    (fun acc e ->
+      if p e
+      then f e :: acc
+      else acc)
+    [] l
+
 let array_index a v =
   let rec loop i =
     if i >= Array.length a
@@ -203,3 +211,10 @@ let make_cache g =
       let v = g k in
       Hashtbl.add tbl k v ;
       v
+
+let hashtbl_of_list l =
+  let tbl = Hashtbl.create (List.length l) in
+  List.iter
+    (fun (k, v) -> Hashtbl.add tbl k v)
+    l ;
+  tbl