* Mono.Documentation/monodocer.cs: Sometimes <AssemblyVersion/> is
authorJonathan Pryor <jpryor@novell.com>
Sun, 2 Aug 2009 11:42:45 +0000 (11:42 -0000)
committerJonathan Pryor <jpryor@novell.com>
Sun, 2 Aug 2009 11:42:45 +0000 (11:42 -0000)
  found twice when it's actually present only once (!).  Attempt to
  work around this by usinq LINQ instead of a foreach (which oddly
  works...).

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

mcs/tools/mdoc/ChangeLog
mcs/tools/mdoc/Mono.Documentation/monodocer.cs

index 02caae629a08053d71314652957998ec4f812217..bf7d09f783a2f420709e3bfe328665454702763c 100644 (file)
@@ -1,3 +1,10 @@
+2009-08-02  Jonathan Pryor <jpryor@novell.com>
+
+       * Mono.Documentation/monodocer.cs: Sometimes <AssemblyVersion/> is
+         found twice when it's actually present only once (!).  Attempt to
+         work around this by usinq LINQ instead of a foreach (which oddly
+         works...).
+
 2009-07-31  Jonathan Pryor <jpryor@novell.com>
 
        * Mono.Documentation/monodocer.cs: Record attributes that are placed
index ab28b50b18b44f8b24f0384f48db85523c4fd39c..3bbbadae03674a50331d86f283d297355be4d1ca 100644 (file)
@@ -2140,12 +2140,9 @@ class MDocUpdater : MDocCommand
                        e = root.OwnerDocument.CreateElement("AssemblyInfo");
                        root.AppendChild(e);
                }
-               MyXmlNodeList matches = new MyXmlNodeList (assemblyVersions.Length);
-               foreach (XmlElement v in e.SelectNodes ("AssemblyVersion")) {
-                       foreach (string sv in assemblyVersions)
-                               if (v.InnerText == sv)
-                                       matches.Add (v);
-               }
+               List<XmlNode> matches = e.SelectNodes ("AssemblyVersion").Cast<XmlNode>()
+                       .Where(v => Array.IndexOf (assemblyVersions, v.InnerText) >= 0)
+                       .ToList ();
                // matches.Count > 0 && add: ignore -- already present
                if (matches.Count > 0 && !add) {
                        foreach (XmlNode c in matches)