Exemplo n.º 1
0
        public unsafe bool ContainsKey(string key)
        {
            if (string.IsNullOrEmpty(key) || this.Bitmask == -1)
            {
                return(false);
            }
            int num = SStr.HashHT(key);

            for (HT_Node *htNodePtr = this.Buckets[this.Bitmask & num].List; (int)htNodePtr > 0; htNodePtr = htNodePtr->Next)
            {
                if (num == htNodePtr->Hash && key == htNodePtr->Key.AsString())
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        public unsafe HT_Node *Lookup(string key)
        {
            if (string.IsNullOrEmpty(key) || this.Bitmask == -1)
            {
                return((HT_Node *)null);
            }
            int num = SStr.HashHT(key);

            for (HT_Node *htNodePtr = this.Buckets[this.Bitmask & num].List; (int)htNodePtr > 0; htNodePtr = htNodePtr->Next)
            {
                if (num == htNodePtr->Hash && key == htNodePtr->Key.AsString())
                {
                    return(htNodePtr);
                }
            }
            return((HT_Node *)null);
        }