[mono-api-info] First filter, then order, and use ordinal comparison.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Wed, 27 Jan 2016 16:38:40 +0000 (17:38 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Thu, 28 Jan 2016 13:49:08 +0000 (14:49 +0100)
mcs/tools/corcompare/mono-api-info.cs

index 4abfffd894633b8951ed31e7fd5899c980793e00..e2bbb36751afd6303549938e30d4f6f541d27fd4 100644 (file)
@@ -1120,10 +1120,12 @@ namespace CorCompare
                                if (ass != null && !Driver.FollowForwarders)
                                        TypeForwardedToData.OutputForwarders (writer, ass);
 
-                               foreach (var att in provider.CustomAttributes.OrderBy ((a) => a.Constructor.DeclaringType.FullName)) {
+                               var attributes = provider.CustomAttributes.
+                                       Where ((att) => !SkipAttribute (att)).
+                                       OrderBy ((a) => a.Constructor.DeclaringType.FullName, StringComparer.Ordinal);
+                               
+                               foreach (var att in attributes) {
                                        string attName = Utils.CleanupTypeName (att.Constructor.DeclaringType);
-                                       if (SkipAttribute (att))
-                                               continue;
 
                                        writer.WriteStartElement ("attribute");
                                        AddAttribute ("name", attName);