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

◆ UnsafeParse()

unsafe void System.Xml.UniqueId.UnsafeParse ( char * chars,
int charCount )
inlineprivate

Definition at line 170 of file UniqueId.cs.

171 {
172 if (charCount != 45 || *chars != 'u' || chars[1] != 'r' || chars[2] != 'n' || chars[3] != ':' || chars[4] != 'u' || chars[5] != 'u' || chars[6] != 'i' || chars[7] != 'd' || chars[8] != ':' || chars[17] != '-' || chars[22] != '-' || chars[27] != '-' || chars[32] != '-')
173 {
174 return;
175 }
176 byte* ptr = stackalloc byte[16];
177 int num = 0;
178 int num2 = 0;
179 fixed (short* ptr2 = &s_char2val[0])
180 {
181 short* char2val = ptr2;
182 num = UnsafeDecode(char2val, chars[15], chars[16]);
183 *ptr = (byte)num;
184 num2 |= num;
185 num = UnsafeDecode(char2val, chars[13], chars[14]);
186 ptr[1] = (byte)num;
187 num2 |= num;
188 num = UnsafeDecode(char2val, chars[11], chars[12]);
189 ptr[2] = (byte)num;
190 num2 |= num;
191 num = UnsafeDecode(char2val, chars[9], chars[10]);
192 ptr[3] = (byte)num;
193 num2 |= num;
194 num = UnsafeDecode(char2val, chars[20], chars[21]);
195 ptr[4] = (byte)num;
196 num2 |= num;
197 num = UnsafeDecode(char2val, chars[18], chars[19]);
198 ptr[5] = (byte)num;
199 num2 |= num;
200 num = UnsafeDecode(char2val, chars[25], chars[26]);
201 ptr[6] = (byte)num;
202 num2 |= num;
203 num = UnsafeDecode(char2val, chars[23], chars[24]);
204 ptr[7] = (byte)num;
205 num2 |= num;
206 num = UnsafeDecode(char2val, chars[28], chars[29]);
207 ptr[8] = (byte)num;
208 num2 |= num;
209 num = UnsafeDecode(char2val, chars[30], chars[31]);
210 ptr[9] = (byte)num;
211 num2 |= num;
212 num = UnsafeDecode(char2val, chars[33], chars[34]);
213 ptr[10] = (byte)num;
214 num2 |= num;
215 num = UnsafeDecode(char2val, chars[35], chars[36]);
216 ptr[11] = (byte)num;
217 num2 |= num;
218 num = UnsafeDecode(char2val, chars[37], chars[38]);
219 ptr[12] = (byte)num;
220 num2 |= num;
221 num = UnsafeDecode(char2val, chars[39], chars[40]);
222 ptr[13] = (byte)num;
223 num2 |= num;
224 num = UnsafeDecode(char2val, chars[41], chars[42]);
225 ptr[14] = (byte)num;
226 num2 |= num;
227 num = UnsafeDecode(char2val, chars[43], chars[44]);
228 ptr[15] = (byte)num;
229 num2 |= num;
230 if (num2 >= 256)
231 {
232 return;
233 }
236 }
237 }
static readonly short[] s_char2val
Definition UniqueId.cs:18
unsafe int UnsafeDecode(short *char2val, char ch1, char ch2)
Definition UniqueId.cs:155
unsafe long UnsafeGetInt64(byte *pb)
Definition UniqueId.cs:398

References System.Xml.UniqueId._idHigh, System.Xml.UniqueId._idLow, System.charCount, System.chars, System.Xml.Dictionary, System.Xml.UniqueId.s_char2val, System.Xml.UniqueId.UnsafeDecode(), and System.Xml.UniqueId.UnsafeGetInt64().

Referenced by System.Xml.UniqueId.UniqueId(), and System.Xml.UniqueId.UniqueId().