diff options
author | jbevain <jbevain@gmail.com> | 2011-02-22 12:43:27 +0300 |
---|---|---|
committer | jbevain <jbevain@gmail.com> | 2011-02-22 12:43:27 +0300 |
commit | c758dec8b92e868b85ff6059815fa42d3f1b0ca6 (patch) | |
tree | e0da2a20d1a964d9b5f888cf4a29555d4d9ccac6 /Mono.Cecil | |
parent | 4d278e38aef36614d11f1514b31eb20d77da32f2 (diff) |
Avoid unecessary closures
Diffstat (limited to 'Mono.Cecil')
-rw-r--r-- | Mono.Cecil/ModuleDefinition.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Mono.Cecil/ModuleDefinition.cs b/Mono.Cecil/ModuleDefinition.cs index 7c793f5..41f5a1d 100644 --- a/Mono.Cecil/ModuleDefinition.cs +++ b/Mono.Cecil/ModuleDefinition.cs @@ -439,7 +439,7 @@ namespace Mono.Cecil { if (!HasImage) return false; - return Read (this, (_, reader) => reader.GetTypeReference (scope, fullName) != null); + return GetTypeReference (scope, fullName) != null; } public bool TryGetTypeReference (string fullName, out TypeReference type) @@ -456,7 +456,12 @@ namespace Mono.Cecil { return false; } - return (type = Read (this, (_, reader) => reader.GetTypeReference (scope, fullName))) != null; + return (type = GetTypeReference (scope, fullName)) != null; + } + + TypeReference GetTypeReference (string scope, string fullname) + { + return Read (new Row<string, string> (scope, fullname), (row, reader) => reader.GetTypeReference (row.Col1, row.Col2)); } public IEnumerable<TypeReference> GetTypeReferences () @@ -755,7 +760,7 @@ namespace Mono.Cecil { public IMetadataTokenProvider LookupToken (MetadataToken token) { - return Read (this, (_, reader) => reader.LookupToken (token)); + return Read (token, (t, reader) => reader.LookupToken (t)); } internal TRet Read<TItem, TRet> (TItem item, Func<TItem, MetadataReader, TRet> read) |