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

◆ Rehash()

void System.Runtime.Serialization.ObjectIDGenerator.Rehash ( )
inlineprivate

Definition at line 92 of file ObjectIDGenerator.cs.

93 {
96 if (num == currentSize)
97 {
98 throw new SerializationException(System.SR.Serialization_TooManyElements);
99 }
100 _currentSize = num;
101 long[] ids = new long[_currentSize * 4];
102 object[] objs = new object[_currentSize * 4];
103 long[] ids2 = _ids;
104 object[] objs2 = _objs;
105 _ids = ids;
106 _objs = objs;
107 for (int i = 0; i < objs2.Length; i++)
108 {
109 if (objs2[i] != null)
110 {
111 bool found;
112 int num2 = FindElement(objs2[i], out found);
113 _objs[num2] = objs2[i];
114 _ids[num2] = ids2[i];
115 }
116 }
117 }
static int ExpandPrime(int oldSize)
int FindElement(object obj, out bool found)
static string Serialization_TooManyElements
Definition SR.cs:26
Definition SR.cs:7

References System.Runtime.Serialization.ObjectIDGenerator._currentSize, System.Runtime.Serialization.ObjectIDGenerator._ids, System.Runtime.Serialization.ObjectIDGenerator._objs, System.Runtime.Serialization.Dictionary, System.Collections.HashHelpers.ExpandPrime(), System.Runtime.Serialization.ObjectIDGenerator.FindElement(), and System.SR.Serialization_TooManyElements.

Referenced by System.Runtime.Serialization.ObjectIDGenerator.GetId().