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

◆ ChangeCaseCommon< TConversion >() [2/3]

unsafe void System.Globalization.TextInfo.ChangeCaseCommon< TConversion > ( ref char source,
ref char destination,
int charCount )
inlineprivate
Type Constraints
TConversion :struct 

Definition at line 220 of file TextInfo.cs.

220 : struct
221 {
222 bool flag = typeof(TConversion) == typeof(ToUpperConversion);
223 if (charCount == 0)
224 {
225 return;
226 }
227 fixed (char* ptr = &source)
228 {
229 fixed (char* ptr2 = &destination)
230 {
231 nuint num = 0u;
233 {
234 if (charCount < 4)
235 {
236 goto IL_00e5;
237 }
238 nuint num2 = (uint)(charCount - 4);
239 while (true)
240 {
241 uint value = Unsafe.ReadUnaligned<uint>(ptr + num);
243 {
244 break;
245 }
247 Unsafe.WriteUnaligned(ptr2 + num, value);
248 value = Unsafe.ReadUnaligned<uint>(ptr + num + 2);
250 {
252 Unsafe.WriteUnaligned(ptr2 + num + 2, value);
253 num += 4;
254 if (num <= num2)
255 {
256 continue;
257 }
258 goto IL_00e5;
259 }
260 num += 2;
261 break;
262 }
263 goto IL_0171;
264 }
265 goto IL_0178;
266 IL_0178:
267 ChangeCaseCore(ptr + num, charCount, ptr2 + num, charCount, flag);
268 return;
269 IL_0171:
270 charCount -= (int)num;
271 goto IL_0178;
272 IL_00e5:
273 if (((uint)charCount & 2u) != 0)
274 {
275 uint value2 = Unsafe.ReadUnaligned<uint>(ptr + num);
277 {
278 goto IL_0171;
279 }
281 Unsafe.WriteUnaligned(ptr2 + num, value2);
282 num += 2;
283 }
284 if (((uint)charCount & (true ? 1u : 0u)) != 0)
285 {
286 uint num3 = ptr[num];
287 if (num3 <= 127)
288 {
290 ptr2[num] = (char)num3;
291 return;
292 }
293 goto IL_0171;
294 }
295 }
296 }
297 }
unsafe void ChangeCaseCore(char *src, int srcLen, char *dstBuffer, int dstBufferCapacity, bool bToUpper)
Definition TextInfo.cs:651
static uint ConvertAllAsciiCharsInUInt32ToLowercase(uint value)
static bool AllCharsInUInt32AreAscii(uint value)
static uint ConvertAllAsciiCharsInUInt32ToUppercase(uint value)

References System.Text.Unicode.Utf16Utility.AllCharsInUInt32AreAscii(), System.Globalization.TextInfo.ChangeCaseCore(), System.charCount, System.Text.Unicode.Utf16Utility.ConvertAllAsciiCharsInUInt32ToLowercase(), System.Text.Unicode.Utf16Utility.ConvertAllAsciiCharsInUInt32ToUppercase(), System.destination, System.Runtime.Serialization.Dictionary, System.Globalization.TextInfo.IsAsciiCasingSameAsInvariant, System.source, and System.value.