Improve performance of Enum.{Try}Parse (#21214)
authorStephen Toub <stoub@microsoft.com>
Thu, 29 Nov 2018 20:59:30 +0000 (15:59 -0500)
committerGitHub <noreply@github.com>
Thu, 29 Nov 2018 20:59:30 +0000 (15:59 -0500)
commit88fb86f36d22c94cb5fc6424110bf3dac37ac83b
tree1cfc306bc543f20d16682d0a4b08bdc05f626ed1
parent11d1b645f0dede73ded0030b56d7c506150b0741
Improve performance of Enum.{Try}Parse (#21214)

* Improve performance of Enum.{Try}Parse

In particular for the generic overloads, where this avoids all per-operation allocations when commonly used underlying types are used (for example, this improves when the underlying enum type is int but not double).

* Address PR feedback
src/System.Private.CoreLib/shared/System/Char.cs
src/System.Private.CoreLib/shared/System/Number.Parsing.cs
src/System.Private.CoreLib/src/System/Enum.cs