Skip to content

Commit

Permalink
Merge pull request #251 from LPCIC/gares-patch-3
Browse files Browse the repository at this point in the history
Use Set.map in compiler
  • Loading branch information
gares authored Jul 30, 2024
2 parents b0b0d6c + f76b4b5 commit 965f44f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,7 @@ let merge t1 t2 =
}

let smart_map (f : typ -> typ) (t : types) : types =
let fold t accu =
let t' = f t in
if t' == t then accu
else Set.add t' (Set.remove t accu)
in
let set' = Set.fold fold t.set t.set in
let set' = Set.map f t.set in
let lst' = smart_map f t.lst in
let def' = f t.def in
if set' == t.set && lst' == t.lst && def' == t.def then t
Expand Down

0 comments on commit 965f44f

Please sign in to comment.