Avoid box allocation in Encoding.EncodingName (dotnet/coreclr#6142)
authorJustin Van Patten <jvp@justinvp.com>
Thu, 7 Jul 2016 21:18:47 +0000 (14:18 -0700)
committerJan Kotas <jkotas@microsoft.com>
Thu, 7 Jul 2016 21:18:47 +0000 (23:18 +0200)
commit1becf213679302ef5ad474b3d48d479b0792bfc7
treed4652192954ff1f84eefbac53d1e42b68c9219e1
parentdb9eb2780c50e42f9a4dc49d14c8e865312baa5a
Avoid box allocation in Encoding.EncodingName (dotnet/coreclr#6142)

`Encoding.EncodingName` concatenates a `string` with an `int` via
`string.Concat(object, object)`, which results in the `int` being
boxed.

This change avoids the box by calling `int.ToString()`,
allowing `string.Concat(string, string)` to be used.

Commit migrated from https://github.com/dotnet/coreclr/commit/a73353e66181706bc98a65b92a921d476bfd322d
src/coreclr/src/mscorlib/src/System/Text/Encoding.cs