public static int GetHashCode <T>(SortedSetValue <T> value) { int hashCode = HashCode.Seed; hashCode = hashCode.HashWith(value.Count); foreach (T element in value) { // Since SortedSet is sorted, we can make a better hash code than XOR. hashCode = hashCode.HashWith(element); } return(hashCode); }
public static bool Equals <T>(SortedSetValue <T> first, SortedSetValue <T> second) => first.SetEquals(second);