Tweak comparison inside string.Split
authorMarek Safar <marek.safar@gmail.com>
Thu, 1 Mar 2012 13:26:57 +0000 (13:26 +0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 2 Mar 2012 16:57:07 +0000 (16:57 +0000)
mcs/class/corlib/System/String.cs

index 9319fc587b5cb5ce963d66d87a72b7e667986f12..7c9670bc4e318bb1bd1639a621b672e9be36509c 100644 (file)
@@ -273,8 +273,8 @@ namespace System
                                        if (sep == null || sep.Length == 0)
                                                continue;
 
-                                       int match = IndexOfOrdinalUnchecked (sep, pos, Length - pos);
-                                       if (match > -1 && match < matchPos) {
+                                       int match = IndexOfOrdinalUnchecked (sep, pos, length - pos);
+                                       if (match >= 0 && match < matchPos) {
                                                matchIndex = i;
                                                matchPos = match;
                                        }