Short-circuit on the count, not the array length, in common Encoding methods (dotnet...
authorJames Ko <jamesqko@gmail.com>
Mon, 4 Jul 2016 05:39:12 +0000 (01:39 -0400)
committerJan Kotas <jkotas@microsoft.com>
Mon, 4 Jul 2016 05:39:12 +0000 (07:39 +0200)
commit8ebdae0c8e945be97091b2c3480426adb0455eb9
treef2fe2c22e249fc6712f0179405df77c0c7c23d6e
parent67371a4bee54919e0f069346bbee6765affc87ef
Short-circuit on the count, not the array length, in common Encoding methods (dotnet/coreclr#6108)

* Short-circuit using count instead of array.Length
* Use Array.Empty in default Reset implementation

Commit migrated from https://github.com/dotnet/coreclr/commit/a1e785dccf35af4305f2536b1e25cb719e8f1943
src/coreclr/src/mscorlib/src/System/Text/ASCIIEncoding.cs
src/coreclr/src/mscorlib/src/System/Text/Decoder.cs
src/coreclr/src/mscorlib/src/System/Text/EncodingNLS.cs
src/coreclr/src/mscorlib/src/System/Text/UTF32Encoding.cs
src/coreclr/src/mscorlib/src/System/Text/UTF7Encoding.cs
src/coreclr/src/mscorlib/src/System/Text/UTF8Encoding.cs
src/coreclr/src/mscorlib/src/System/Text/UnicodeEncoding.cs