2001-09-06 Jeffrey Stedfast <fejj@ximian.com>
authorJeffrey Stedfast <fejj@novell.com>
Thu, 6 Sep 2001 14:21:30 +0000 (14:21 -0000)
committerJeffrey Stedfast <fejj@novell.com>
Thu, 6 Sep 2001 14:21:30 +0000 (14:21 -0000)
* String.cs (System): Don't mix uint and int.

svn path=/trunk/mcs/; revision=730

mcs/class/corlib/System/String.cs

index 82a72e22b0df8b8bbb6c11b4d8c3b4b48f8b230c..fa6cc692c89a0a377e1c9e50c913792ef0a940e8 100644 (file)
@@ -200,7 +200,7 @@ namespace System {
                private static int BoyerMoore (char[] haystack, string needle, int startIndex, int count)
                {
                        /* (hopefully) Unicode-safe Boyer-Moore implementation */
-                       uint[] skiptable = new uint[65536];  /* our unicode-safe skip-table */
+                       int[] skiptable = new uint[65536];  /* our unicode-safe skip-table */
                        int h, n, he, ne, hc, nc, i;
 
                        if (haystack == null || needle == null)
@@ -226,7 +226,7 @@ namespace System {
                         * pattern buffer (needle) to the distance from the index to
                         * the end of the pattern buffer. */
                        for (nc = 0; nc < ne; nc++)
-                               skiptable[(uint) needle[nc]] = ne - nc;
+                               skiptable[(int) needle[nc]] = ne - nc;
 
                        h = startIndex;
                        while (count >= needle.Length) {
@@ -239,7 +239,7 @@ namespace System {
                                                break;
 
                                if (needle[nc] != haystack[hc]) {
-                                       n = skiptable[(uint) haystack[hc]] - i;
+                                       n = skiptable[(int) haystack[hc]] - i;
                                        h += n;
                                        count -= n;
                                } else