Pchp.Core.Utilities.ElasticBitArray.this C# (CSharp) Method

this() public method

Gets or sets index-th bit in the array.
public this ( int index ) : bool
index int
return bool
        public bool this[int index]
        {
            get
            {
                var num = index / IntSize;

                if (index >= 0 && num < _bits.Length)
                {
                    return (_bits[num] & (1 << (index % IntSize))) != 0;
                }

                return false;
            }
            set
            {
                if (value)
                    SetTrue(index);
                else
                    SetFalse(index);
            }
        }