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

◆ Resize()

XHashtableState System.Xml.Linq.XHashtable< TValue >.XHashtableState.Resize ( )
inline

Definition at line 36 of file XHashtable.cs.

37 {
38 if (_numEntries < _buckets.Length)
39 {
40 return this;
41 }
42 int num = 0;
43 for (int i = 0; i < _buckets.Length; i++)
44 {
45 int num2 = _buckets[i];
46 if (num2 == 0)
47 {
49 }
50 while (num2 > 0)
51 {
52 if (_extractKey(_entries[num2].Value) != null)
53 {
54 num++;
55 }
56 num2 = ((_entries[num2].Next != 0) ? _entries[num2].Next : Interlocked.CompareExchange(ref _entries[num2].Next, -1, 0));
57 }
58 }
59 if (num < _buckets.Length / 2)
60 {
61 num = _buckets.Length;
62 }
63 else
64 {
65 num = _buckets.Length * 2;
66 if (num < 0)
67 {
68 throw new OverflowException();
69 }
70 }
72 for (int j = 0; j < _buckets.Length; j++)
73 {
74 for (int num3 = _buckets[j]; num3 > 0; num3 = _entries[num3].Next)
75 {
77 }
78 }
79 return xHashtableState;
80 }
static int CompareExchange(ref int location1, int value, int comparand)
readonly ExtractKeyDelegate _extractKey
Definition XHashtable.cs:27
XHashtableState(ExtractKeyDelegate extractKey, int capacity)
Definition XHashtable.cs:29

References System.Xml.Linq.XHashtable< TValue >.XHashtableState.XHashtableState(), System.Xml.Linq.XHashtable< TValue >.XHashtableState._buckets, System.Xml.Linq.XHashtable< TValue >.XHashtableState._entries, System.Xml.Linq.XHashtable< TValue >.XHashtableState._extractKey, System.Xml.Linq.XHashtable< TValue >.XHashtableState._numEntries, System.Threading.Interlocked.CompareExchange(), System.Xml.Dictionary, System.Xml.Linq.XHashtable< TValue >.XHashtableState.Entry.Next, and System.Xml.Linq.Value.

Referenced by System.Xml.Linq.XHashtable< TValue >.Add().