Example #1
0
 /// <summary>
 /// Returns true if this set contains only the specified element.
 /// </summary>
 public bool IsSingleton(TElement element)
 {
     return(1 == Count && ElementEqualityComparer.Equals(_array[0], element));
 }
Example #2
0
 protected virtual bool AreEquals(EqualityComparerContext context, T x, T y) =>
 (!context.TryAdd(x) | !context.TryAdd(y)) || ElementEqualityComparer.Equals(x, y);