diff options
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | utils/consistbl.ml | 5 |
2 files changed, 4 insertions, 5 deletions
@@ -8,7 +8,9 @@ Compilers: Runtime system: - PR#6517: use ISO C99 types {,u}int{32,64}_t in preference to our homegrown types {,u}int{32,64}. - + (Xavier Leroy) +- PR#6529: fix quadratic-time algorithm in Consistbl.extract. + (Xavier Leroy) Ocaml 4.02.0: ------------- diff --git a/utils/consistbl.ml b/utils/consistbl.ml index 6adaf41122..37f6a2b1e6 100644 --- a/utils/consistbl.ml +++ b/utils/consistbl.ml @@ -41,12 +41,9 @@ let set tbl name crc source = Hashtbl.add tbl name (crc, source) let source tbl name = snd (Hashtbl.find tbl name) let extract l tbl = + let l = List.sort_uniq String.compare l in List.fold_left (fun assc name -> - try - ignore (List.assoc name assc); - assc - with Not_found -> try let (crc, _) = Hashtbl.find tbl name in (name, Some crc) :: assc |