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

◆ FindEntry()

int System.Runtime.CompilerServices.ConditionalWeakTable< TKey, TValue >.Container.FindEntry ( TKey key,
out object value )
inlinepackage

Definition at line 164 of file ConditionalWeakTable.cs.

165 {
166 int num = RuntimeHelpers.GetHashCode(key) & 0x7FFFFFFF;
167 int num2 = num & (_buckets.Length - 1);
168 for (int num3 = Volatile.Read(ref _buckets[num2]); num3 != -1; num3 = _entries[num3].Next)
169 {
170 if (_entries[num3].HashCode == num && _entries[num3].depHnd.UnsafeGetTargetAndDependent(out value) == key)
171 {
172 GC.KeepAlive(this);
173 return num3;
174 }
175 }
176 GC.KeepAlive(this);
177 value = null;
178 return -1;
179 }
static bool Read(ref bool location)
Definition Volatile.cs:67

References System.Runtime.CompilerServices.ConditionalWeakTable< TKey, TValue >.Container._buckets, System.Runtime.CompilerServices.ConditionalWeakTable< TKey, TValue >.Container._entries, System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(), System.GC.KeepAlive(), System.key, System.Runtime.CompilerServices.ConditionalWeakTable< TKey, TValue >.Entry.Next, System.Threading.Volatile.Read(), and System.value.

Referenced by System.Runtime.CompilerServices.ConditionalWeakTable< TKey, TValue >.Container.Remove(), and System.Runtime.CompilerServices.ConditionalWeakTable< TKey, TValue >.Container.TryGetValueWorker().