src/AnvilPacker/Util/Collections/BitSet.cs
/// <summary> Sets the bit in the specified range to true. </summary>
Sets the bit in the specified range to true.
Sets the bit in the specified range to true .
public void Set(int offset, int count)
        {
            EnsureCapacity(offset + count);
            int end = offset + count;
            int startWord = offset >> 6;
            int endWord = end >> 6;
            ulong firstWordMask = WORD_ALL << offset;
            ulong lastWordMask = WORD_ALL >> -end;
            if (startWord == endWord) {
                _vals[startWord] |= firstWordMask & lastWordMask;
            } else {
                for (int i = startWord + 1; i < endWord; i++) {
                    _vals[i] = WORD_ALL;
                }
                _vals[startWord] |= firstWordMask;
                _vals[endWord] |= lastWordMask;
            }
        }
public void Set ( int offset , int count ) { EnsureCapacity ( offset + count ) ; int end = offset + count ; int startWord = offset >> 6 ; int endWord = end >> 6 ; ulong firstWordMask = WORD_ALL << offset ; ulong lastWordMask = WORD_ALL >> - end ; if ( startWord == endWord ) { _vals [ startWord ] |= firstWordMask & lastWordMask ; } else { for ( int i = startWord + 1 ; i < endWord ; i ++ ) { _vals [ i ] = WORD_ALL ; } _vals [ startWord ] |= firstWordMask ; _vals [ endWord ] |= lastWordMask ; } }
Sets the bit in the specified range to true.
Sets the bit in the specified range to true .
offset
int
count
int