Delete unnecessary internal layer of Span globalization helpers (#17890)
authorJan Kotas <jkotas@microsoft.com>
Sun, 6 May 2018 02:58:04 +0000 (19:58 -0700)
committerGitHub <noreply@github.com>
Sun, 6 May 2018 02:58:04 +0000 (19:58 -0700)
commit0ba6924dbc8477e4ecfbb8fd7793c2788bd48cd9
tree978b8016dedfda568c70e0d83f9a707819d46fc5
parentbf3a442e01e1ee50dad89b4125a28bc025886a36
Delete unnecessary internal layer of Span globalization helpers (#17890)

This change makes the code both smaller and faster. For example, the following is about 1.4x faster with this change:

```
ReadOnlySpan<char> s1 = "Hello world";
ReadOnlySpan<char> s2 = "world";
for (int i = 0; i < 100000000; i++) s1.EndsWith(s2, StringComparison.OrdinalIgnoreCase);
```

Also, I have ported GetCaseCompareOfComparisonCulture code size optimization from #16434 while I was on it because of it fit well with the rest of the changes.
src/mscorlib/shared/System/Globalization/TextInfo.cs
src/mscorlib/shared/System/MemoryExtensions.Fast.cs
src/mscorlib/shared/System/SpanHelpers.cs
src/mscorlib/shared/System/String.Comparison.cs
src/mscorlib/shared/System/String.Manipulation.cs
src/mscorlib/shared/System/String.Searching.cs