daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -Naur ocaml-4.00.1/typing/typedecl.ml ocaml-4.00.1-fast-typedecl/typing/typedecl.ml
  2. --- ocaml-4.00.1/typing/typedecl.ml 2013-03-12 14:24:13.886509684 +0100
  3. +++ ocaml-4.00.1-fast-typedecl/typing/typedecl.ml   2013-03-12 14:24:04.469509844 +0100
  4. @@ -315,6 +315,8 @@
  5.        Btype.iter_type_expr (check_constraints_rec env loc visited) ty
  6.    end
  7.  
  8. +module SMap = Map.Make(String)
  9. +
  10.  let check_constraints env (_, sdecl) (_, decl) =
  11.    let visited = ref TypeSet.empty in
  12.    begin match decl.type_kind with
  13. @@ -325,13 +327,16 @@
  14.          | Ptype_record _ | Ptype_abstract -> assert false
  15.        in
  16.        let pl = find_pl sdecl.ptype_kind in
  17. +      let pl_index =
  18. +        let foldf acc (name, styl, sret_type, _) =
  19. +          SMap.add name.txt (styl, sret_type) acc
  20. +        in
  21. +        List.fold_left foldf SMap.empty pl
  22. +      in
  23.        List.iter
  24.          (fun (name, tyl, ret_type) ->
  25.            let (styl, sret_type) =
  26. -            try
  27. -              let (_, sty, sret_type, _) =
  28. -                List.find (fun (n,_,_,_) -> n.txt = Ident.name name)  pl
  29. -              in (sty, sret_type)
  30. +            try SMap.find (Ident.name name) pl_index
  31.              with Not_found -> assert false in
  32.            List.iter2
  33.              (fun sty ty ->
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top