コード例 #1
0
        public bool IsSupersetOf(VectorFlatHashSet <T> other)
        {
            if (other.Size > Size)
            {
                return(false);
            }

            return(other.ForEach(Contains) == Size);
        }
コード例 #2
0
        /// <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));
        }