diff options
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/evd.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pretyping/evd.ml b/pretyping/evd.ml index cd02d7228a..c60fb29586 100644 --- a/pretyping/evd.ml +++ b/pretyping/evd.ml @@ -960,8 +960,11 @@ let merge_uctx rigid uctx ctx' = | UnivRigid -> uctx | UnivFlexible b -> let levels = Univ.ContextSet.levels ctx' in - let uvars' = Univ.LMap.bind (fun _ -> None) levels in - let uvars' = Univ.LMap.fold Univ.LMap.add uctx.uctx_univ_variables uvars' in + let fold u accu = + if Univ.LMap.mem u accu then accu + else Univ.LMap.add u None accu + in + let uvars' = Univ.LSet.fold fold levels uctx.uctx_univ_variables in if b then { uctx with uctx_univ_variables = uvars'; uctx_univ_algebraic = Univ.LSet.union uctx.uctx_univ_algebraic levels } |
