public static int H(PxEntry tree) { return(tree.Tag() == 0 ? 0 : 1 + Math.Max(H(tree.UElementUnchecked(1).Field(1)), H(tree.UElementUnchecked(1).Field(2)))); }
private static bool Equals(PxEntry left, PxEntry right, Func <object, object, bool> elementsComparer) { int tag; if ((tag = left.Tag()) != right.Tag()) { return(false); } if (tag == 0) { return(true); } var r = right.UElement(); var l = right.UElement(); bool @equals = elementsComparer(r.Field(0).Get(), l.Field(0).Get()); // bool b = (int) r.Field(3).Get().Value == (int) l.Field(3).Get().Value; return(@equals // && b && Equals(r.Field(1), l.Field(1)) && Equals(r.Field(2), l.Field(2))); }