Deduplicate Binary Integer parsing logic (#84582)
authorTanner Gooding <tagoo@outlook.com>
Mon, 17 Apr 2023 22:28:40 +0000 (15:28 -0700)
committerGitHub <noreply@github.com>
Mon, 17 Apr 2023 22:28:40 +0000 (15:28 -0700)
commit07834fdf017a7629dee7d6773c4bf00112c0f86f
treee7d48b8c6fa3e990a853f05a9b4350e24d4e16cd
parentadd51b82baf268c3678bdd124480a46b89d72ce4
Deduplicate Binary Integer parsing logic (#84582)

* Deduplicate TryNumberToInt*

* Deduplicate TryParseInt*IntegerStyle parsing methods

* Deduplicate TryParseInt*HexNumberStyle

* Deduplicate TryParseInt*Number

* Deduplicate TryParseInt*

* Deduplicate ParseInt*

* Deduplicate some more binary integer parsing logic

* Ensure the right overflow message is used for binary integer parsing

* Ensure HasTrailingCharsZero handling is in the right spot

* Resolving PR feedback

* Revert using the public throw helpers
16 files changed:
src/libraries/System.Private.CoreLib/src/System/Byte.cs
src/libraries/System.Private.CoreLib/src/System/Char.cs
src/libraries/System.Private.CoreLib/src/System/Enum.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/NumberFormatInfo.cs
src/libraries/System.Private.CoreLib/src/System/Guid.cs
src/libraries/System.Private.CoreLib/src/System/Int128.cs
src/libraries/System.Private.CoreLib/src/System/Int16.cs
src/libraries/System.Private.CoreLib/src/System/Int32.cs
src/libraries/System.Private.CoreLib/src/System/Int64.cs
src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs
src/libraries/System.Private.CoreLib/src/System/SByte.cs
src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs
src/libraries/System.Private.CoreLib/src/System/UInt128.cs
src/libraries/System.Private.CoreLib/src/System/UInt16.cs
src/libraries/System.Private.CoreLib/src/System/UInt32.cs
src/libraries/System.Private.CoreLib/src/System/UInt64.cs