2006-04-26 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 26 Apr 2006 08:10:14 +0000 (08:10 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 26 Apr 2006 08:10:14 +0000 (08:10 -0000)
* Comparer.cs : changed internal field from CultureInfo to
  CompareInfo. This cosmetic change should fix bug #77701.

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

mcs/class/corlib/System.Collections/ChangeLog
mcs/class/corlib/System.Collections/Comparer.cs

index 4f1a00391d9d9156ff31233bf27452bed32a0169..937c890babd5fc77e7ad1e7aa1e16e830d4e14d2 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-26  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * Comparer.cs : changed internal field from CultureInfo to
+         CompareInfo. This cosmetic change should fix bug #77701.
+
 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
 
        * Stack.cs: Changed ctor to allocate only requested memory.
index ad71142f7cc44a64a220f5aa7b081b92ae0b02b3..2f2ca54a58586b8f6c42ac3d57184f35b214e591 100644 (file)
@@ -48,7 +48,8 @@ namespace System.Collections
 #endif
                static readonly Comparer DefaultInvariant = new Comparer (CultureInfo.InvariantCulture);
 
-               CultureInfo _culture;
+               // This field was introduced for MS kompatibility. see bug #77701
+               CompareInfo m_compareInfo;
 
                private Comparer ()
                {
@@ -65,7 +66,7 @@ namespace System.Collections
                        if (culture == null)
                                throw new ArgumentNullException ("culture");
 
-                       _culture = culture;
+                       m_compareInfo = culture.CompareInfo;
                }
 
 
@@ -79,11 +80,11 @@ namespace System.Collections
                        else if (b == null)
                                return 1;
 
-                       if (_culture != null) {
+                       if (m_compareInfo != null) {
                                string sa = a as string;
                                string sb = b as string;
                                if (sa != null && sb != null)
-                                       return _culture.CompareInfo.Compare (sa, sb);
+                                       return m_compareInfo.Compare (sa, sb);
                        }
 
                        if (a is IComparable)
@@ -101,7 +102,7 @@ namespace System.Collections
                        if (info == null)
                                throw new ArgumentNullException ("info");
 
-                       info.AddValue ("CompareInfo", _culture.CompareInfo, typeof (CompareInfo));
+                       info.AddValue ("CompareInfo", m_compareInfo, typeof (CompareInfo));
                }
        }
 }