Explorar o código

* CaseInsensitiveHashCodeProvider.cs: If the culture is null, don't use
Char.ToLower(c,culture), since it does not accept null as culture.

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

Lluis Sanchez %!s(int64=22) %!d(string=hai) anos
pai
achega
0cc0202ef8

+ 11 - 3
mcs/class/corlib/System.Collections/CaseInsensitiveHashCodeProvider.cs

@@ -86,9 +86,17 @@ namespace System.Collections {
 			char c;
 
 			int length = str.Length;
-			for (int i = 0;i<length;i++) {
-				c = Char.ToLower (str [i], culture);
-				h = h * 31 + c;
+			if (culture != null) {
+				for (int i = 0;i<length;i++) {
+					c = Char.ToLower (str [i], culture);
+					h = h * 31 + c;
+				}
+			}
+			else {
+				for (int i = 0;i<length;i++) {
+					c = Char.ToLower (str [i]);
+					h = h * 31 + c;
+				}
 			}
 
 			return h;

+ 5 - 0
mcs/class/corlib/System.Collections/ChangeLog

@@ -1,3 +1,8 @@
+2004-04-21  Lluis Sanchez Gual  <[email protected]>
+
+	* CaseInsensitiveHashCodeProvider.cs: If the culture is null, don't use
+	  Char.ToLower(c,culture), since it does not accept null as culture.
+
 2004-04-20  Lluis Sanchez Gual  <[email protected]>
 
 	* Queue.cs: Renamed internal membesr to match MS.NET (to allow serialization