Pass target string lengths to ICU on Unix
authorstephentoub <stoub@microsoft.com>
Fri, 13 Nov 2015 13:59:12 +0000 (08:59 -0500)
committerstephentoub <stoub@microsoft.com>
Fri, 13 Nov 2015 15:25:30 +0000 (10:25 -0500)
commitb5920928d8824aba40a6a848729979d5b26028f4
tree56ee225fc9f7e59f090d5d4bba243029788483e0
parent09917c891af09a41dd9e2159d1c0095881e1a43f
Pass target string lengths to ICU on Unix

Our current ICU shims for StartsWith, EndsWith, IndexOf, and LastIndexOf
take the length of the source string but not the length of the target
string.  This forces ICU to compute the length of the string by searching
for a null terminator.  We can save those costs and be more accurate
around nulls in the target string by passing the known length in.
src/corefx/System.Globalization.Native/collation.cpp
src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs
src/mscorlib/corefx/System/Globalization/CompareInfo.Unix.cs