diff options
| author | Gaëtan Gilbert | 2019-05-07 15:09:26 +0200 |
|---|---|---|
| committer | Gaëtan Gilbert | 2019-05-07 15:09:26 +0200 |
| commit | 8bb85530fbf5b6de1cb268004611c6f76fb5871e (patch) | |
| tree | aafb6a002fa14d333d60832e60fcb90ba3990e1e | |
| parent | 403f8784706d54e5e91bf20e56b0bf8ea40f4df3 (diff) | |
Avoid trivial (u=u) constraints in AcyclicGraph.constraints_for
Not sure how often this happens in practice but it seems it could.
| -rw-r--r-- | lib/acyclicGraph.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/acyclicGraph.ml b/lib/acyclicGraph.ml index 7d04c8f5a1..e1dcfcc6ce 100644 --- a/lib/acyclicGraph.ml +++ b/lib/acyclicGraph.ml @@ -721,7 +721,10 @@ module Make (Point:Point) = struct let rmap, csts = PSet.fold (fun u (rmap,csts) -> let arcu = repr g u in if PSet.mem arcu.canon kept then - PMap.add arcu.canon arcu.canon rmap, Constraint.add (u,Eq,arcu.canon) csts + let csts = if Point.equal u arcu.canon then csts + else Constraint.add (u,Eq,arcu.canon) csts + in + PMap.add arcu.canon arcu.canon rmap, csts else match PMap.find arcu.canon rmap with | v -> rmap, Constraint.add (u,Eq,v) csts |
