Lucene.Net.Support.BitSetSupport.NextSetBit C# (CSharp) Метод

NextSetBit() публичный статический Метод

Returns the next set bit at or after index, or -1 if no such bit exists.
public static NextSetBit ( this bitArray, int index ) : int
bitArray this
index int the index of bit array at which to start checking
Результат int
        public static int NextSetBit(this BitArray bitArray, int index)
        {
            while (index < bitArray.Length)
            {
                // if index bit is set, return it
                // otherwise check next index bit
                if (bitArray.Get(index))
                    return index;
                else
                    index++;
            }
            // if no bits are set at or after index, return -1
            return -1;
        }