62,266
社区成员
发帖
与我相关
我的任务
分享
public virtual void Remove(object key)
{
uint num;
uint num2;
Hashtable.bucket bucket;
if (key == null)
{
throw new ArgumentNullException("key", Environment.GetResourceString("ArgumentNull_Key"));
}
uint num3 = this.InitHash(key, this.buckets.Length, out num, out num2);
int num4 = 0;
int index = (int) (num % this.buckets.Length);
Label_003A:
bucket = this.buckets[index];
if (((bucket.hash_coll & 0x7fffffff) == num3) && this.KeyEquals(bucket.key, key))
{
Thread.BeginCriticalRegion();
this.isWriterInProgress = true;
this.buckets[index].hash_coll &= -2147483648;
if (this.buckets[index].hash_coll != 0)
{
this.buckets[index].key = this.buckets;
}
else
{
this.buckets[index].key = null;
}
this.buckets[index].val = null;
this.count--;
this.UpdateVersion();
this.isWriterInProgress = false;
Thread.EndCriticalRegion();
}
else
{
index = (int) ((index + num2) % ((ulong) this.buckets.Length));
if ((bucket.hash_coll < 0) && (++num4 < this.buckets.Length))
{
goto Label_003A;
}
}
}