Port System.Memory performance improvements to Convert.TryFromBase64Chars (#17033)
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>
Tue, 20 Mar 2018 21:14:41 +0000 (14:14 -0700)
committerGitHub <noreply@github.com>
Tue, 20 Mar 2018 21:14:41 +0000 (14:14 -0700)
commite0fa11308de58684cde6bf8b7d0da287b48f01e9
tree300aff8cbfb435661fa2ea1041b61227254ac37f
parent0597eed6a6674ad0b0f531a851475c212c7478c5
Port System.Memory performance improvements to Convert.TryFromBase64Chars (#17033)

* Copy over Base64.DecodeFromUtf8 verbatim

* Don't need the InPlace api

* Change input from Utf8 to Utf16

* isFinalBlock will always be true, so constant fold it through

* I only need a true/false result, so get rid of OperationStatus

* Rename variables to reflect Utf8->Utf16 change

* Update comments and some minor cleanup

* Make Convert use Base64 as a fast-path

* Incorporate PR feedback.

* Delete FromBase64_Decode

* Use a single safe stackalloc

* Rename Base64.cs to Convert.Base64.cs

and make its contents a part of the Convert class.

We should eventually move all the Base64-related
stuff into this new file but not as part of this PR.
We want to be able to diff the implementation change
separately from the code movement.

* Thanks VS for the unasked for indent
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/Convert.Base64.cs [new file with mode: 0644]
src/mscorlib/shared/System/Convert.cs