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

◆ TryParseUInt32D()

static bool System.Buffers.Text.Utf8Parser.TryParseUInt32D ( ReadOnlySpan< byte > source,
out uint value,
out int bytesConsumed )
inlinestaticprivate

Definition at line 2527 of file Utf8Parser.cs.

2528 {
2529 int num;
2530 int num3;
2531 int num2;
2532 if (source.Length >= 1)
2533 {
2534 num = 0;
2535 num2 = source[num];
2536 num3 = 0;
2537 if (ParserHelpers.IsDigit(num2))
2538 {
2539 if (num2 != 48)
2540 {
2541 goto IL_0056;
2542 }
2543 while (true)
2544 {
2545 num++;
2546 if ((uint)num >= (uint)source.Length)
2547 {
2548 break;
2549 }
2550 num2 = source[num];
2551 if (num2 == 48)
2552 {
2553 continue;
2554 }
2555 goto IL_004b;
2556 }
2557 goto IL_023d;
2558 }
2559 }
2560 goto IL_0235;
2561 IL_004b:
2562 if (ParserHelpers.IsDigit(num2))
2563 {
2564 goto IL_0056;
2565 }
2566 goto IL_023d;
2567 IL_0056:
2568 num3 = num2 - 48;
2569 num++;
2570 if ((uint)num < (uint)source.Length)
2571 {
2572 num2 = source[num];
2573 if (ParserHelpers.IsDigit(num2))
2574 {
2575 num++;
2576 num3 = 10 * num3 + num2 - 48;
2577 if ((uint)num < (uint)source.Length)
2578 {
2579 num2 = source[num];
2580 if (ParserHelpers.IsDigit(num2))
2581 {
2582 num++;
2583 num3 = 10 * num3 + num2 - 48;
2584 if ((uint)num < (uint)source.Length)
2585 {
2586 num2 = source[num];
2587 if (ParserHelpers.IsDigit(num2))
2588 {
2589 num++;
2590 num3 = 10 * num3 + num2 - 48;
2591 if ((uint)num < (uint)source.Length)
2592 {
2593 num2 = source[num];
2594 if (ParserHelpers.IsDigit(num2))
2595 {
2596 num++;
2597 num3 = 10 * num3 + num2 - 48;
2598 if ((uint)num < (uint)source.Length)
2599 {
2600 num2 = source[num];
2601 if (ParserHelpers.IsDigit(num2))
2602 {
2603 num++;
2604 num3 = 10 * num3 + num2 - 48;
2605 if ((uint)num < (uint)source.Length)
2606 {
2607 num2 = source[num];
2608 if (ParserHelpers.IsDigit(num2))
2609 {
2610 num++;
2611 num3 = 10 * num3 + num2 - 48;
2612 if ((uint)num < (uint)source.Length)
2613 {
2614 num2 = source[num];
2615 if (ParserHelpers.IsDigit(num2))
2616 {
2617 num++;
2618 num3 = 10 * num3 + num2 - 48;
2619 if ((uint)num < (uint)source.Length)
2620 {
2621 num2 = source[num];
2622 if (ParserHelpers.IsDigit(num2))
2623 {
2624 num++;
2625 num3 = 10 * num3 + num2 - 48;
2626 if ((uint)num < (uint)source.Length)
2627 {
2628 num2 = source[num];
2629 if (ParserHelpers.IsDigit(num2))
2630 {
2631 num++;
2632 if ((uint)num3 <= 429496729u && (num3 != 429496729 || num2 <= 53))
2633 {
2634 num3 = num3 * 10 + num2 - 48;
2635 if ((uint)num >= (uint)source.Length || !ParserHelpers.IsDigit(source[num]))
2636 {
2637 goto IL_023d;
2638 }
2639 }
2640 goto IL_0235;
2641 }
2642 }
2643 }
2644 }
2645 }
2646 }
2647 }
2648 }
2649 }
2650 }
2651 }
2652 }
2653 }
2654 }
2655 }
2656 }
2657 }
2658 }
2659 goto IL_023d;
2660 IL_023d:
2661 bytesConsumed = num;
2662 value = (uint)num3;
2663 return true;
2664 IL_0235:
2665 bytesConsumed = 0;
2666 value = 0u;
2667 return false;
2668 }

References System.Buffers.Text.ParserHelpers.IsDigit(), System.source, and System.value.

Referenced by System.Buffers.Text.Utf8Parser.TimeSpanSplitter.ParseComponent(), System.Buffers.Text.Utf8Parser.TryParse(), System.Buffers.Text.Utf8Parser.TryParseNumber(), System.Buffers.Text.Utf8Parser.TryParseTimeSpanBigG(), and System.Buffers.Text.Utf8Parser.TimeSpanSplitter.TrySplitTimeSpan().