src/AnvilPacker/Data/BitArrays/SparseBitStorage.cs
/// <summary> Sets the element at the specified index. Value will be truncated to <see cref="BitsPerElement"/> bits.</summary>
Sets the element at the specified index. Value will be truncated to  bits.
Sets the element at the specified index . Value will be truncated to bits .
public void Set(int index, int value)
        {
            Ensure.IndexValid(index, Count);
            int dataIndex = index / valuesPerLong;
            int shift = (index - dataIndex * valuesPerLong) * BitsPerElement;
            ref long v = ref Mem.GetRef(Data, dataIndex);
            v = (v & ~(mask << shift)) | (value & mask) << shift;
        }
public void Set ( int index , int value ) { Ensure . IndexValid ( index , Count ) ; int dataIndex = index / valuesPerLong ; int shift = ( index - dataIndex * valuesPerLong ) * BitsPerElement ; ref long v = ref Mem . GetRef ( Data , dataIndex ) ; v = ( v & ~ ( mask << shift ) ) | ( value & mask ) << shift ; }
Sets the element at the specified index.
Sets the element at the specified index .
index
int
value
int