[mono-api-info] Use ordinal string comparison. It's much faster.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 27 Jan 2016 16:36:00 +0000 (17:36 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 28 Jan 2016 13:49:03 +0000 (14:49 +0100)
mcs/tools/corcompare/mono-api-info.cs

index 29cc3e58a6df17c6ee108a10842dc9ad391aa6fa..1e5fcd0e02167661f07bf87bbbf48720d161b7a1 100644 (file)
@@ -486,7 +486,7 @@ namespace CorCompare
 
                        var ifaces =  TypeHelper.GetInterfaces (type).
                                Where ((iface) => TypeHelper.IsPublic (iface)). // we're only interested in public interfaces
-                               OrderBy (s => s.FullName);
+                               OrderBy (s => s.FullName, StringComparer.Ordinal);
 
                        if (ifaces.Any ()) {
                                writer.WriteStartElement ("interfaces");
@@ -699,7 +699,7 @@ namespace CorCompare
 
                        var methods = type.Methods;//type.GetMethods (flags);
                        foreach (MethodDefinition method in methods) {
-                               if (method.IsSpecialName && !method.Name.StartsWith ("op_"))
+                               if (method.IsSpecialName && !method.Name.StartsWith ("op_", StringComparison.Ordinal))
                                        continue;
 
                                // we're only interested in public or protected members
@@ -1143,7 +1143,7 @@ namespace CorCompare
                                                                AddAttribute ("value", "null");
                                                        } else {
                                                                string value = o.ToString ();
-                                                               if (attName.EndsWith ("GuidAttribute"))
+                                                               if (attName.EndsWith ("GuidAttribute", StringComparison.Ordinal))
                                                                        value = value.ToUpper ();
                                                                AddAttribute ("value", value);
                                                        }
@@ -1486,7 +1486,7 @@ namespace CorCompare
 
                public int Compare (PropertyDefinition ma, PropertyDefinition mb)
                {
-                       int res = String.Compare (ma.Name, mb.Name);
+                       int res = String.Compare (ma.Name, mb.Name, StringComparison.Ordinal);
                        if (res != 0)
                                return res;
 
@@ -1511,7 +1511,7 @@ namespace CorCompare
                {
                        MethodDefinition ma = (MethodDefinition) a;
                        MethodDefinition mb = (MethodDefinition) b;
-                       int res = String.Compare (ma.Name, mb.Name);
+                       int res = String.Compare (ma.Name, mb.Name, StringComparison.Ordinal);
                        if (res != 0)
                                return res;
 
@@ -1540,7 +1540,7 @@ namespace CorCompare
 
                        string siga = Parameters.GetSignature (pia);
                        string sigb = Parameters.GetSignature (pib);
-                       return String.Compare (siga, sigb);
+                       return String.Compare (siga, sigb, StringComparison.Ordinal);
                }
        }
 }