File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,20 @@ let name () = "string"
44
55type string_domain = Unit | Disjoint | Flat
66
7- let string_domain = ref None
7+ let string_domain: string_domain ResettableLazy. t =
8+ ResettableLazy. from_fun (fun () ->
9+ match GobConfig. get_string " ana.base.strings.domain" with
10+ | "unit" -> Unit
11+ | "disjoint" -> Disjoint
12+ | "flat" -> Flat
13+ | _ -> failwith " ana.base.strings.domain: illegal value"
14+ )
815
9- let string_domain_config = " ana.base.strings.domain"
10-
11- let parse config = match config with
12- | "unit" -> Unit
13- | "disjoint" -> Disjoint
14- | "flat" -> Flat
15- | _ -> raise @@ GobConfig. ConfigError (" Invalid option for " ^ string_domain_config)
16-
17- let get_string_domain () =
18- if ! string_domain = None then
19- string_domain := Some (parse (GobConfig. get_string string_domain_config));
20- Option. get ! string_domain
16+ let get_string_domain () = ResettableLazy. force string_domain
2117
2218let reset_lazy () =
23- string_domain := None
19+ ResettableLazy. reset string_domain
20+
2421
2522type t = string option [@@ deriving eq , ord , hash ]
2623
You can’t perform that action at this time.
0 commit comments