public void Set(int index, bool val)
{
lock (_lock)
{
if (_usingIndexes)
{
IsDirty = true;
_offsets.RemoveAll(i => i == index);
if (val)
{
_offsets.Add((uint) index);
// set max
if (index > _curMax)
_curMax = (uint) index;
}
ChangeTypeIfNeeded();
return;
}
CheckBitArray();
Resize(index);
InternalSet(index, val);
}
}