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

◆ TryParseUInt64N()

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

Definition at line 3014 of file Utf8Parser.cs.

3015 {
3016 int num;
3017 long num3;
3018 int num2;
3019 if (source.Length >= 1)
3020 {
3021 num = 0;
3022 num2 = source[num];
3023 if (num2 == 43)
3024 {
3025 num++;
3026 if ((uint)num >= (uint)source.Length)
3027 {
3028 goto IL_00eb;
3029 }
3030 num2 = source[num];
3031 }
3032 if (num2 != 46)
3033 {
3034 if (ParserHelpers.IsDigit(num2))
3035 {
3036 num3 = num2 - 48;
3037 while (true)
3038 {
3039 num++;
3040 if ((uint)num >= (uint)source.Length)
3041 {
3042 break;
3043 }
3044 num2 = source[num];
3045 if (num2 == 44)
3046 {
3047 continue;
3048 }
3049 if (num2 == 46)
3050 {
3051 goto IL_00c6;
3052 }
3053 if (!ParserHelpers.IsDigit(num2))
3054 {
3055 break;
3056 }
3057 if ((ulong)num3 <= 1844674407370955161uL && (num3 != 1844674407370955161L || num2 <= 53))
3058 {
3059 num3 = num3 * 10 + num2 - 48;
3060 continue;
3061 }
3062 goto IL_00eb;
3063 }
3064 goto IL_00f4;
3065 }
3066 }
3067 else
3068 {
3069 num3 = 0L;
3070 num++;
3071 if ((uint)num < (uint)source.Length && source[num] == 48)
3072 {
3073 goto IL_00c6;
3074 }
3075 }
3076 }
3077 goto IL_00eb;
3078 IL_00eb:
3079 bytesConsumed = 0;
3080 value = 0uL;
3081 return false;
3082 IL_00c6:
3083 while (true)
3084 {
3085 num++;
3086 if ((uint)num >= (uint)source.Length)
3087 {
3088 break;
3089 }
3090 num2 = source[num];
3091 if (num2 == 48)
3092 {
3093 continue;
3094 }
3095 goto IL_00e3;
3096 }
3097 goto IL_00f4;
3098 IL_00f4:
3099 bytesConsumed = num;
3100 value = (ulong)num3;
3101 return true;
3102 IL_00e3:
3103 if (ParserHelpers.IsDigit(num2))
3104 {
3105 goto IL_00eb;
3106 }
3107 goto IL_00f4;
3108 }

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

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