diff options
author | jfrijters <jfrijters> | 2011-03-17 13:01:58 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-03-17 13:01:58 +0300 |
commit | ee5fc81328bdc3b71eef5683574cb81260e303d6 (patch) | |
tree | b4fc3a73cd90e5bb18bdf09442086a4a9a46a217 /reflect/Reader | |
parent | 128a11f836e1145aea8369dfc0a3f76d67ce5107 (diff) |
Don't needlessly read the contents of a resource module.
Diffstat (limited to 'reflect/Reader')
-rw-r--r-- | reflect/Reader/AssemblyReader.cs | 6 |
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); } } |