Further improve perf of Char.IsWhiteSpace (#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)
commit7c197b63914af560d467e8a95c04177495f160d9
treefc7f82510341ee99fa022c579c3c7c32cffc00e1
parentd6d35047a2d0ef27ccfe5c55bbacdb99bda84e44
Further improve perf of Char.IsWhiteSpace (#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.
src/mscorlib/shared/System/Char.cs