BitsetsNET.BitsetContainer.Remove C# (CSharp) Method

Remove() public method

Remove specified short from this container. May create a new container.
public Remove ( ushort x ) : Container
x ushort Short to be removed
return Container
        public override Container Remove(ushort x)
        {
            int index = x / 64;
            long bef = Bitmap[index];
            long mask = (1L << x);

            if (Cardinality == ArrayContainer.DEFAULT_MAX_SIZE + 1)
            {// this is
             // the
             // uncommon
             // path
                if ((bef & mask) != 0)
                {
                    --Cardinality;
                    Bitmap[x / 64] = bef & (~mask);
                    return this.ToArrayContainer();
                }
            }

            long aft = bef & (~mask);
            Cardinality -= (aft - bef) != 0 ? 1 : 0;
            Bitmap[index] = aft;
            return this;
        }

Same methods

BitsetContainer::Remove ( ushort begin, ushort end ) : Container