예제 #1
0
        public override string Add(char[] array, int offset, int length)
        {
            if (length == 0)
            {
                return("");
            }
            int num1 = length;
            int num2 = num1 + (num1 << 7 ^ (int)array[offset]);
            int num3 = offset + length;

            for (int index = offset + 1; index < num3; ++index)
            {
                num2 += num2 << 7 ^ (int)array[index];
            }
            int num4     = num2 - (num2 >> 17);
            int num5     = num4 - (num4 >> 11);
            int hashCode = num5 - (num5 >> 5);

            for (NameTable.Entry entry = this.entries[hashCode & this.mask]; entry != null; entry = entry.next)
            {
                if (entry.hashCode == hashCode && NameTable.TextEquals(entry.str, array, offset))
                {
                    return(entry.str);
                }
            }
            return(this.AddEntry(new string(array, offset, length), hashCode));
        }