- Map.fold_flatten
- (fun domain_item codomain_item acc ->
- if not (Map.mem domain_item from.aliases) then
- Map.cons domain_item codomain_item acc
- else
- begin
- try
- let codomain1 = Map.find domain_item from.aliases in
- let codomain2 = Map.find domain_item status.aliases in
- List.fold_right
- (fun item env ->
- let dsc = fst item in
- if not (List.exists (fun (dsc', _) -> dsc'=dsc) codomain1) then
- Map.cons domain_item codomain_item env
- else
- env)
- codomain2 acc
- with Not_found -> acc
- end)
+ Map.fold
+ (fun domain_item (description1,_ as codomain_item) acc ->
+ try
+ let description2,_ = Map.find domain_item from.aliases in
+ if description1 <> description2 then
+ Map.add domain_item codomain_item acc
+ else
+ acc
+ with
+ Not_found ->
+ Map.add domain_item codomain_item acc)