Simplify the type comparison of Java classes

Reviewed By: cristianoc

Differential Revision: D2876204

fb-gh-sync-id: d6a1849
master
Jeremy Dubreil 9 years ago committed by facebook-github-bot-1
parent 5da7823df5
commit 70dbe8db74

@ -1298,11 +1298,14 @@ let rec const_compare (c1 : const) (c2 : const) : int =
| Ctuple el1, Ctuple el2 -> IList.compare exp_compare el1 el2 | Ctuple el1, Ctuple el2 -> IList.compare exp_compare el1 el2
and struct_typ_compare struct_typ1 struct_typ2 = and struct_typ_compare struct_typ1 struct_typ2 =
let n = fld_typ_ann_list_compare struct_typ1.instance_fields struct_typ2.instance_fields in if struct_typ1.csu = Csu.Class Csu.Java && struct_typ2.csu = Csu.Class Csu.Java then
if n <> 0 then n else cname_opt_compare struct_typ1.struct_name struct_typ2.struct_name
let n = fld_typ_ann_list_compare struct_typ1.static_fields struct_typ2.static_fields in else
if n <> 0 then n else let n = Csu.compare struct_typ1.csu struct_typ2.csu in let n = fld_typ_ann_list_compare struct_typ1.instance_fields struct_typ2.instance_fields in
if n <> 0 then n else cname_opt_compare struct_typ1.struct_name struct_typ2.struct_name if n <> 0 then n else
let n = fld_typ_ann_list_compare struct_typ1.static_fields struct_typ2.static_fields in
if n <> 0 then n else let n = Csu.compare struct_typ1.csu struct_typ2.csu in
if n <> 0 then n else cname_opt_compare struct_typ1.struct_name struct_typ2.struct_name
(** Comparision for types. *) (** Comparision for types. *)
and typ_compare t1 t2 = and typ_compare t1 t2 =

Loading…
Cancel
Save