Cache source files.
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 24 Aug 2011 20:30:42 +0000 (17:30 -0300)
committerZoltan Varga <vargaz@gmail.com>
Thu, 29 Sep 2011 00:09:26 +0000 (02:09 +0200)
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/TypeMirror.cs

index d17fac5dd8d1d8d9c4668b4bcc00af8f68d345e9..fac5133cfa158611c02f911f5340ad4a9637d345 100644 (file)
@@ -525,8 +525,18 @@ namespace Mono.Debugger.Soft
                        return GetSourceFiles (false);
                }
 
+               string[] source_files;
+               string[] source_files_full_path;
                public string[] GetSourceFiles (bool return_full_paths) {
-                       return vm.conn.Type_GetSourceFiles (id, return_full_paths);
+                       string[] res = return_full_paths ? source_files_full_path : source_files;
+                       if (res == null) {
+                               res = vm.conn.Type_GetSourceFiles (id, return_full_paths);
+                               if (return_full_paths)
+                                       source_files_full_path = res;
+                               else
+                                       source_files = res;
+                       }
+                       return res;
                }
 
                public C.TypeDefinition Metadata {