Пример #1
0
        public override string Get(char[] key, int start, int length)
        {
            if (length == 0)
            {
                return(string.Empty);
            }
            int num = length + DefaultJsonNameTable.HashCodeRandomizer;

            num += (num << 7 ^ (int)key[start]);
            int num2 = start + length;

            for (int i = start + 1; i < num2; i++)
            {
                num += (num << 7 ^ (int)key[i]);
            }
            num -= num >> 17;
            num -= num >> 11;
            num -= num >> 5;
            int num3 = num & this._mask;

            for (DefaultJsonNameTable.Entry entry = this._entries[num3]; entry != null; entry = entry.Next)
            {
                if (entry.HashCode == num && DefaultJsonNameTable.TextEquals(entry.Value, key, start, length))
                {
                    return(entry.Value);
                }
            }
            return(null);
        }
Пример #2
0
        public override string Get(char[] key, int start, int length)
        {
            if (length == 0)
            {
                return(string.Empty);
            }
            int num = length + DefaultJsonNameTable.HashCodeRandomizer;

            num = num + (num << 7 ^ key[start]);
            int num1 = start + length;

            for (int i = start + 1; i < num1; i++)
            {
                num = num + (num << 7 ^ key[i]);
            }
            num = num - (num >> 17);
            num = num - (num >> 11);
            num = num - (num >> 5);
            int num2 = num & this._mask;

            for (DefaultJsonNameTable.Entry j = this._entries[num2]; j != null; j = j.Next)
            {
                if (j.HashCode == num && DefaultJsonNameTable.TextEquals(j.Value, key, start, length))
                {
                    return(j.Value);
                }
            }
            return(null);
        }