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

◆ FixDefaultShortDatePattern()

static void System.Globalization.CalendarData.FixDefaultShortDatePattern ( List< string > shortDatePatterns)
inlinestaticprivate

Definition at line 480 of file CalendarData.cs.

481 {
482 if (shortDatePatterns.Count == 0)
483 {
484 return;
485 }
486 string text = shortDatePatterns[0];
487 if (text.Length > 100)
488 {
489 return;
490 }
491 Span<char> span = stackalloc char[text.Length + 2];
492 int i;
493 for (i = 0; i < text.Length; i++)
494 {
495 if (text[i] == '\'')
496 {
497 do
498 {
499 span[i] = text[i];
500 i++;
501 }
502 while (i < text.Length && text[i] != '\'');
503 if (i >= text.Length)
504 {
505 return;
506 }
507 }
508 else if (text[i] == 'y')
509 {
510 span[i] = 'y';
511 break;
512 }
513 span[i] = text[i];
514 }
515 if (i >= text.Length - 1 || text[i + 1] != 'y' || (i + 2 < text.Length && text[i + 2] == 'y'))
516 {
517 return;
518 }
519 span[i + 1] = 'y';
520 span[i + 2] = 'y';
521 span[i + 3] = 'y';
522 for (i += 2; i < text.Length; i++)
523 {
524 span[i + 2] = text[i];
525 }
526 shortDatePatterns[0] = span.ToString();
527 for (int j = 1; j < shortDatePatterns.Count; j++)
528 {
530 {
532 return;
533 }
534 }
536 }
void Add(TKey key, TValue value)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, and System.text.

Referenced by System.Globalization.CalendarData.EnumDatePatterns().