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

◆ Remove()

virtual void System.Collections.Hashtable.Remove ( object key)
inlinevirtualinherited

Implements System.Collections.IDictionary.

Reimplemented in System.Collections.Hashtable.SyncHashtable.

Definition at line 1028 of file Hashtable.cs.

1029 {
1030 if (key == null)
1031 {
1032 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
1033 }
1034 uint seed;
1035 uint incr;
1036 uint num = InitHash(key, _buckets.Length, out seed, out incr);
1037 int num2 = 0;
1038 int num3 = (int)(seed % (uint)_buckets.Length);
1039 bucket bucket;
1040 do
1041 {
1042 bucket = _buckets[num3];
1043 if ((bucket.hash_coll & 0x7FFFFFFF) == num && KeyEquals(bucket.key, key))
1044 {
1045 _isWriterInProgress = true;
1046 _buckets[num3].hash_coll &= int.MinValue;
1047 if (_buckets[num3].hash_coll != 0)
1048 {
1050 }
1051 else
1052 {
1053 _buckets[num3].key = null;
1054 }
1055 _buckets[num3].val = null;
1056 _count--;
1057 UpdateVersion();
1058 _isWriterInProgress = false;
1059 break;
1060 }
1061 num3 = (int)((num3 + incr) % (uint)_buckets.Length);
1062 }
1063 while (bucket.hash_coll < 0 && ++num2 < _buckets.Length);
1064 }
uint InitHash(object key, int hashsize, out uint seed, out uint incr)
Definition Hashtable.cs:669
volatile bool _isWriterInProgress
Definition Hashtable.cs:407
virtual bool KeyEquals(object? item, object key)
Definition Hashtable.cs:918

References System.Collections.Hashtable._buckets, System.Collections.Hashtable._count, System.Collections.Hashtable._isWriterInProgress, 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, System.Collections.Hashtable.KeyEquals(), System.Collections.Hashtable.UpdateVersion(), and System.Collections.Hashtable.bucket.val.

Referenced by System.Collections.DictionaryBase.Add(), System.Xml.Schema.XmlSchemaSet.Add(), System.Xml.Schema.XmlSchemaCollection.AddNonThreadSafe(), System.Xml.XmlDataDocument.AddPointer(), System.Collections.Specialized.NameObjectCollectionBase.BaseRemove(), System.Collections.Specialized.NameObjectCollectionBase.BaseRemoveAt(), System.Net.CookieContainer.BuildCookieCollectionFromDomainMatches(), System.Transactions.FinalizedObject.Dispose(), System.Net.CookieContainer.DomainTableCleanup(), System.Transactions.TransactionManager.FindOrCreatePromotedTransaction(), System.Transactions.TransactionManager.FindPromotedTransaction(), System.Data.DataViewSettingCollection.Remove(), System.Collections.DictionaryBase.Remove(), System.Collections.Specialized.HybridDictionary.Remove(), System.Collections.Specialized.OrderedDictionary.Remove(), System.Collections.Hashtable.SyncHashtable.Remove(), System.Xml.Serialization.CodeIdentifiers.Remove(), System.Collections.Specialized.StringDictionary.Remove(), System.Xml.Schema.XmlSchemaSet.Remove(), System.Collections.Specialized.OrderedDictionary.RemoveAt(), System.Xml.XmlDocument.RemoveElementWithId(), System.Xml.Xsl.XsltArgumentList.RemoveExtensionObject(), System.Xml.Schema.NamespaceList.RemoveNamespace(), System.Xml.Xsl.XsltArgumentList.RemoveParam(), System.Net.HttpListener.RemovePrefix(), System.Xml.Serialization.CodeIdentifiers.RemoveReserved(), System.Xml.Schema.XmlSchemaSet.RemoveSchemaFromCaches(), System.Runtime.Serialization.SurrogateSelector.RemoveSurrogate(), System.ComponentModel.PropertyDescriptor.RemoveValueChanged(), System.Xml.Schema.XmlSchemaSet.Reprocess(), and System.Xml.Serialization.XmlSerializationWriter.WriteEndElement().