diff options
author | Jérémie Laval <jeremie.laval@gmail.com> | 2013-06-06 18:51:37 +0400 |
---|---|---|
committer | Jérémie Laval <jeremie.laval@gmail.com> | 2013-06-06 18:51:37 +0400 |
commit | 04618c181025955d226d928c72b0e624d42e6904 (patch) | |
tree | b6f3ae0d0f3aae291cd4cd97993fc05f71ce6914 /mcs | |
parent | 9c4ee217323dc15daa3891d7bd5576487c8de2b4 (diff) |
[monodoc] Cache assembly loaded with MonoImpInfo. Patch by Aaron Oneal.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs b/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs index c73ed1907e2..c15c6137786 100644 --- a/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs +++ b/mcs/class/monodoc/Monodoc/generators/html/Ecma2Html.cs @@ -113,6 +113,7 @@ namespace Monodoc.Generators.Html public class ExtensionObject { bool quiet = true; + Dictionary<string, System.Reflection.Assembly> assemblyCache = new Dictionary<string, System.Reflection.Assembly> (); public string Colorize(string code, string lang) { @@ -216,7 +217,11 @@ namespace Monodoc.Generators.Html System.Reflection.Assembly assembly = null; try { - assembly = System.Reflection.Assembly.LoadWithPartialName(assemblyname); + if (!assemblyCache.TryGetValue (assemblyname, out assembly)) { + assembly = System.Reflection.Assembly.LoadWithPartialName(assemblyname); + if (assembly != null) + assemblyCache[assemblyname] = assembly; + } } catch (Exception) { // nothing. } @@ -272,7 +277,13 @@ namespace Monodoc.Generators.Html if (assemblyname == string.Empty) return string.Empty; - var assembly = System.Reflection.Assembly.LoadWithPartialName(assemblyname); + System.Reflection.Assembly assembly; + if (!assemblyCache.TryGetValue (assemblyname, out assembly)) { + assembly = System.Reflection.Assembly.LoadWithPartialName(assemblyname); + if (assembly != null) + assemblyCache[assemblyname] = assembly; + } + if (assembly == null) return string.Empty; |