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

◆ MoveNext()

bool System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator.MoveNext ( )
inline

Implements System.Collections.IEnumerator.

Definition at line 49 of file ConcurrentDictionary.cs.

50 {
51 switch (_state)
52 {
53 case 0:
55 _i = -1;
56 goto case 1;
57 case 1:
58 {
59 Node[] buckets = _buckets;
60 int num = ++_i;
61 if ((uint)num >= (uint)buckets.Length)
62 {
63 break;
64 }
65 _node = Volatile.Read(ref buckets[num]);
66 _state = 2;
67 goto case 2;
68 }
69 case 2:
70 {
71 Node node = _node;
72 if (node != null)
73 {
74 Current = new KeyValuePair<TKey, TValue>(node._key, node._value);
75 _node = node._next;
76 return true;
77 }
78 goto case 1;
79 }
80 }
81 _state = 3;
82 return false;
83 }
readonly ConcurrentDictionary< TKey, TValue > _dictionary
static bool Read(ref bool location)
Definition Volatile.cs:67

References System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator._buckets, System.Collections.Generic.Dictionary< TKey, TValue >._buckets, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator._dictionary, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator._i, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator._node, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator._state, System.Collections.Concurrent.ConcurrentDictionary< TKey, TValue >.Enumerator.Current, and System.Threading.Volatile.Read().