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

◆ TryParseUInt32N()

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

Definition at line 2918 of file Utf8Parser.cs.

2919 {
2920 int num;
2921 int num3;
2922 int num2;
2923 if (source.Length >= 1)
2924 {
2925 num = 0;
2926 num2 = source[num];
2927 if (num2 == 43)
2928 {
2929 num++;
2930 if ((uint)num >= (uint)source.Length)
2931 {
2932 goto IL_00de;
2933 }
2934 num2 = source[num];
2935 }
2936 if (num2 != 46)
2937 {
2938 if (ParserHelpers.IsDigit(num2))
2939 {
2940 num3 = num2 - 48;
2941 while (true)
2942 {
2943 num++;
2944 if ((uint)num >= (uint)source.Length)
2945 {
2946 break;
2947 }
2948 num2 = source[num];
2949 if (num2 == 44)
2950 {
2951 continue;
2952 }
2953 if (num2 == 46)
2954 {
2955 goto IL_00b9;
2956 }
2957 if (!ParserHelpers.IsDigit(num2))
2958 {
2959 break;
2960 }
2961 if ((uint)num3 <= 429496729u && (num3 != 429496729 || num2 <= 53))
2962 {
2963 num3 = num3 * 10 + num2 - 48;
2964 continue;
2965 }
2966 goto IL_00de;
2967 }
2968 goto IL_00e6;
2969 }
2970 }
2971 else
2972 {
2973 num3 = 0;
2974 num++;
2975 if ((uint)num < (uint)source.Length && source[num] == 48)
2976 {
2977 goto IL_00b9;
2978 }
2979 }
2980 }
2981 goto IL_00de;
2982 IL_00de:
2983 bytesConsumed = 0;
2984 value = 0u;
2985 return false;
2986 IL_00b9:
2987 while (true)
2988 {
2989 num++;
2990 if ((uint)num >= (uint)source.Length)
2991 {
2992 break;
2993 }
2994 num2 = source[num];
2995 if (num2 == 48)
2996 {
2997 continue;
2998 }
2999 goto IL_00d6;
3000 }
3001 goto IL_00e6;
3002 IL_00e6:
3003 bytesConsumed = num;
3004 value = (uint)num3;
3005 return true;
3006 IL_00d6:
3007 if (ParserHelpers.IsDigit(num2))
3008 {
3009 goto IL_00de;
3010 }
3011 goto IL_00e6;
3012 }

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

Referenced by System.Buffers.Text.Utf8Parser.TryParse().