From 859157c4a7cf7f9945d1c04f595dfe9acd09f906 Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Thu, 5 Nov 2009 15:44:43 +0000 Subject: [PATCH] A case was missing --- helm/software/components/extlib/hExtlib.ml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/helm/software/components/extlib/hExtlib.ml b/helm/software/components/extlib/hExtlib.ml index 13dd2f266..0536a1d6e 100644 --- a/helm/software/components/extlib/hExtlib.ml +++ b/helm/software/components/extlib/hExtlib.ml @@ -343,16 +343,18 @@ let rec rm_assoc n = function let merge canonicals elements n m = let cn,canonicals = rm_assoc n canonicals in let cm,canonicals = rm_assoc m canonicals in - let ln,elements = rm_assoc cn elements in - let lm,elements = rm_assoc cm elements in - let canonicals = - (n,cm)::(m,cm)::List.map - (fun ((x,xc) as p) -> - if xc = cn then (x,cm) else p) canonicals - in - let elements = (cm,ln@lm)::elements - in - canonicals,elements + if cn=cm then (n,cm)::(m,cm)::canonicals, elements + else + let ln,elements = rm_assoc cn elements in + let lm,elements = rm_assoc cm elements in + let canonicals = + (n,cm)::(m,cm)::List.map + (fun ((x,xc) as p) -> + if xc = cn then (x,cm) else p) canonicals + in + let elements = (cm,ln@lm)::elements + in + canonicals,elements ;; (* f x gives the direct dependencies of x; -- 2.39.2