Avoid loading the same documentation file twice
authorMiguel de Icaza <miguel@gnome.org>
Fri, 7 Oct 2011 20:22:41 +0000 (16:22 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 7 Oct 2011 20:23:04 +0000 (16:23 -0400)
mcs/tools/monodoc/Monodoc/provider.cs

index c2cee5592224a25433ccb313bd2b4a1067fda383..6bf99d86b827d009672fdaf118784f63f065977f 100644 (file)
@@ -906,6 +906,7 @@ public class RootTree : Tree {
                                docTree.Load (defTree);
                }
 
+
                sourceFiles = sourceFiles ?? new string [0];
 
                //
@@ -930,8 +931,9 @@ public class RootTree : Tree {
                //
                // Load the sources
                //
-               foreach (var sourceFile in sourceFiles)
+               foreach (var sourceFile in sourceFiles){
                        root.AddSourceFile (sourceFile);
+               }
                
                foreach (string path in UncompiledHelpSources) {
                        EcmaUncompiledHelpSource hs = new EcmaUncompiledHelpSource(path);
@@ -965,8 +967,13 @@ public class RootTree : Tree {
                }
        }
 
+       Dictionary<string,string> loadedSourceFiles = new Dictionary<string,string> ();
+       
        public void AddSourceFile (string sourceFile)
        {
+               if (loadedSourceFiles.ContainsKey (sourceFile))
+                       return;
+               
                Node third_party = LookupEntryPoint ("various") ?? this;
 
                XmlDocument doc = new XmlDocument ();
@@ -987,6 +994,7 @@ public class RootTree : Tree {
                        Console.Error.WriteLine ("Error: No <source> section found in the {0} file", sourceFile);
                        return;
                }
+               loadedSourceFiles [sourceFile] = sourceFile;
                foreach (XmlNode source in sources){
                        XmlAttribute a = source.Attributes ["provider"];
                        if (a == null){