Further improve perf of Char.IsWhiteSpace (dotnet/coreclr#12353)
authorStephen Toub <stoub@microsoft.com>
Sun, 18 Jun 2017 01:40:38 +0000 (21:40 -0400)
committerJan Kotas <jkotas@microsoft.com>
Sun, 18 Jun 2017 01:40:38 +0000 (18:40 -0700)
commit2f2ac00387affb7570c69513298aa8bcf8733114
treecadcfff49d6890133c3626dc6f943f9976020c46
parent2d25d2794444772b3cd6e38dab8818fefa066b5d
Further improve perf of Char.IsWhiteSpace (dotnet/coreclr#12353)

IsWhiteSpaceLatin1 is not being inlined.  By changing a range check done with two comparison operations to instead be done with a subtraction and a single comparison, the code is shortened to not only be less expensive but also then get inlined into IsWhiteSpace and then further into String.IsNullOrWhiteSpace.  The net result is a measurable throughput improvement for IsNullOrWhiteSpace.

Commit migrated from https://github.com/dotnet/coreclr/commit/7c197b63914af560d467e8a95c04177495f160d9
src/coreclr/src/mscorlib/shared/System/Char.cs