public void AddRange(char first, char last)
{
if (first >= last)
//throw new ArgumentException(CoreResources.GetString("last_is_less_than_first"));
throw new ArgumentException();
int modf = first & 0x1f;
int modl = last & 0x1f;
int f = first >> 5;
int l = last >> 5;
if (l == f)
{
flags[f] |= (0xffffffffU >> (31 - modl + modf)) << (31 - modl);
}
else
{
// the first block:
flags[f] |= 0xffffffffU >> modf;
// the middle blocks (if any):
for (int i = f + 1; i < l; i++)
flags[i] = 0xffffffffU;
// the last block:
if (modl < 31)
flags[l] |= ~(0xffffffffU >> (modl + 1));
else
flags[l] = 0xffffffffU;
}
if (l > lastDirty) lastDirty = l;
}