Exemplo n.º 1
0
            // Lookup returns the atom whose name is s. It returns zero if there is no
            // such atom. The lookup is case sensitive.
            public static AtomType Lookup(byte[] s)
            {
                if (s.Length == 0 || s.Length > maxAtomLen)
                {
                    return(0);
                }
                var      h = fnv(hash0, s);
                AtomType a = table[h & (uint)(table.Length - 1)];

                if ((a & 0xff) == s.Length && match(a.ToStringUnsafe(), s))
                {
                    return(a);
                }
                a = table[(h >> 16) & (uint)(table.Length - 1)];
                if ((a & 0xff) == s.Length && match(a.ToStringUnsafe(), s))
                {
                    return(a);
                }
                return(0);
            }