public bool IsSupersetOf(VectorFlatHashSet <T> other) { if (other.Size > Size) { return(false); } return(other.ForEach(Contains) == Size); }
/// <inheritdoc /> /// <remarks>Validate correctness</remarks> public bool SetEquals(IEnumerable <T> other) { if (other is ICollection coll) { return(Count == coll.Count && IsSupersetOf(other)); } var tmp = new VectorFlatHashSet <T>(other); if (tmp.Size != Size) { return(false); } return(tmp.Size > Size?tmp.IsSupersetOf(this) : IsSupersetOf(tmp)); }