Beispiel #1
0
    bool CheckIsSubsetOf(HashSetEx<T> other)
    {
      foreach (var item in this)
        if (!other.Contains(item))
          return false;

      return true;
    }
Beispiel #2
0
      public bool Equals(HashSetEx<T> lhs, HashSetEx<T> rhs)
      {
        if (lhs == rhs)
          return true;

        if (lhs == null || rhs == null || lhs.Count != rhs.Count)
          return false;

        // The following check assumes that both HashSetEx<T> use the same IEqualityComparer<T>!
        foreach (var item in lhs)
          if (!rhs.Contains(item))
            return false;

        return true;
      }