Pchp.Library.CharMap.AddRange C# (CSharp) Method

AddRange() public method

Adds a range of characters to the set.
or are not mapped by this instance. The is less than the .
public AddRange ( char first, char last ) : void
first char The lower bound of the range.
last char The upper bound of the range.
return void
        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;
        }