Special-case value.Length == 0 in LastIndexOfOrdinal
authorStephen Toub <stoub@microsoft.com>
Wed, 1 Apr 2015 03:20:44 +0000 (23:20 -0400)
committerStephen Toub <stoub@microsoft.com>
Wed, 1 Apr 2015 03:20:44 +0000 (23:20 -0400)
commit535074add2b44bc358ad507e0e8289159f545f1f
tree968dec0c557c57ad4d1a51c585f3109dc85de91d
parent524f5463406df065474b342086e6dfe38ddfbda3
Special-case value.Length == 0 in LastIndexOfOrdinal

With https://github.com/dotnet/coreclr/pull/579, I added to IndexOfOrdinal a check for value.Length == 0, to avoid returning bad data in that case.  But in doing so, and in neglecting to add a similar check to LastIndexOfOrdinal (which is currently implemented in terms of IndexOfOrdinal), I introduced an infinite loop into LastIndexOfOrdinal when value.Length == 0.  Fixing by adding a similar special-case.
src/mscorlib/corefx/System/Globalization/CompareInfo.Unix.cs