Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2011-03-17 13:01:58 +0300
committerjfrijters <jfrijters>2011-03-17 13:01:58 +0300
commitee5fc81328bdc3b71eef5683574cb81260e303d6 (patch)
treeb4fc3a73cd90e5bb18bdf09442086a4a9a46a217 /reflect/Reader
parent128a11f836e1145aea8369dfc0a3f76d67ce5107 (diff)
Don't needlessly read the contents of a resource module.
Diffstat (limited to 'reflect/Reader')
-rw-r--r--reflect/Reader/AssemblyReader.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/reflect/Reader/AssemblyReader.cs b/reflect/Reader/AssemblyReader.cs
index 504d386f..9d3a3415 100644
--- a/reflect/Reader/AssemblyReader.cs
+++ b/reflect/Reader/AssemblyReader.cs
@@ -193,7 +193,7 @@ namespace IKVM.Reflection.Reader
}
// TODO add ModuleResolve event
string location = Path.Combine(Path.GetDirectoryName(this.location), manifestModule.GetString(manifestModule.File.records[index].Name));
- return LoadModule(index, File.ReadAllBytes(location), location);
+ return LoadModule(index, null, location);
}
private Module LoadModule(int index, byte[] rawModule, string location)
@@ -204,6 +204,10 @@ namespace IKVM.Reflection.Reader
}
else
{
+ if (rawModule == null)
+ {
+ rawModule = File.ReadAllBytes(location);
+ }
return externalModules[index] = new ModuleReader(this, manifestModule.universe, new MemoryStream(rawModule), location);
}
}