Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ContainsKey()

virtual bool System.Collections.Hashtable.ContainsKey ( object key)
inlinevirtualinherited

Reimplemented in System.Collections.Hashtable.SyncHashtable.

Definition at line 724 of file Hashtable.cs.

725 {
726 if (key == null)
727 {
728 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
729 }
730 bucket[] buckets = _buckets;
731 uint seed;
732 uint incr;
733 uint num = InitHash(key, buckets.Length, out seed, out incr);
734 int num2 = 0;
735 int num3 = (int)(seed % (uint)buckets.Length);
736 bucket bucket;
737 do
738 {
739 bucket = buckets[num3];
740 if (bucket.key == null)
741 {
742 return false;
743 }
744 if ((bucket.hash_coll & 0x7FFFFFFF) == num && KeyEquals(bucket.key, key))
745 {
746 return true;
747 }
748 num3 = (int)((num3 + incr) % (uint)buckets.Length);
749 }
750 while (bucket.hash_coll < 0 && ++num2 < buckets.Length);
751 return false;
752 }
uint InitHash(object key, int hashsize, out uint seed, out uint incr)
Definition Hashtable.cs:669
virtual bool KeyEquals(object? item, object key)
Definition Hashtable.cs:918

References System.Collections.Hashtable._buckets, System.SR.ArgumentNull_Key, System.Runtime.Serialization.Dictionary, System.Collections.Hashtable.bucket.hash_coll, System.Collections.Hashtable.InitHash(), System.Collections.Hashtable.bucket.key, System.key, and System.Collections.Hashtable.KeyEquals().

Referenced by System.Xml.Xsl.XsltOld.Stylesheet.AddAttributeSet(), System.Xml.Xsl.XsltOld.Stylesheet.AddTemplate(), System.Collections.Hashtable.Contains(), System.Collections.Hashtable.SyncHashtable.ContainsKey(), System.Collections.Specialized.StringDictionary.ContainsKey(), System.Xml.Xsl.XsltOld.XsltCompileContext.Document(), System.Data.XSDSchema.HandleConstraint(), System.Text.RegularExpressions.RegexParser.IsCaptureName(), System.Text.RegularExpressions.RegexParser.IsCaptureSlot(), System.Text.RegularExpressions.RegexParser.NoteCaptureName(), System.Text.RegularExpressions.RegexParser.NoteCaptureSlot(), System.Collections.HashtableExtensions.TryGetValue< T >(), and System.Xml.Serialization.XmlSerializationWriter.WriteStartElement().