Commits

Peter Szilagyi committed 5cb9114

Don't accumulate default values in the configuration.
Only save explicit user settings.

Comments (0)

Files changed (1)

ocaml/omake/config.ml

 let lookup t ~key ~default =
   let key = String.lowercase key in
   let default = String.lowercase default in
-  Hashtbl.find_or_add t key ~default:(fun () -> default)
+  Hashtbl.find t key |! Option.value ~default
 
 let read_file file =
   try
     let s = Sexp.load_sexp file in
+    (* CR pszilagyi: Why is this downcased?  Won't that mangle shell commands with
+       uppercase letters in them? *)
     let sexp_of_string s = String.lowercase (String.t_of_sexp s) in
     Ok (T.t_of_sexp sexp_of_string s)
   with exn -> Error exn
 
 let update t ~key ~value =
   let key = String.lowercase key in
+  (* CR pszilagyi: Why downcase the value? *)
   let value = String.lowercase value in
   T.replace t ~key ~data:value