Skip to content
Permalink
Browse files

redundant variables

  • Loading branch information
SimonCropp committed Mar 10, 2020
1 parent 0c55dff commit 2638af9fd63e4873f9c06fe684483758fe062264
@@ -84,7 +84,6 @@ public IEnumerable<PEFile> GetAllModules()
public IEnumerable<ITypeDefinition> GetTypesInScope(CancellationToken ct)
{
if (IsLocal) {
var typeSystem = new DecompilerTypeSystem(TypeScope.ParentModule.PEFile, TypeScope.ParentModule.PEFile.GetAssemblyResolver());
foreach (var type in TreeTraversal.PreOrder(typeScope, t => t.NestedTypes)) {
yield return type;
}
@@ -32,7 +32,6 @@ static class DebugInfoUtils
public static IDebugInfoProvider LoadSymbols(PEFile module)
{
try {
var reader = module.Reader;
// try to open portable pdb file/embedded pdb info:
if (TryOpenPortablePdb(module, out var provider, out var pdbFileName)) {
return new PortableDebugInfoProvider(pdbFileName, provider);
@@ -121,7 +121,6 @@ public override void DecompileMethod(IMethod method, ITextOutput output, Decompi
reader.UseDebugSymbols = options.DecompilerSettings.UseDebugSymbols;
var methodBody = module.Reader.GetMethodBody(methodDef.RelativeVirtualAddress);
ILFunction il = reader.ReadIL((SRM.MethodDefinitionHandle)method.MetadataToken, methodBody, kind: ILFunctionKind.TopLevelFunction, cancellationToken: options.CancellationToken);
var namespaces = new HashSet<string>();
var decompiler = new CSharpDecompiler(typeSystem, options.DecompilerSettings) { CancellationToken = options.CancellationToken };
ILTransformContext context = decompiler.CreateILTransformContext(il);
context.Stepper.StepLimit = options.StepLimit;
@@ -489,9 +489,6 @@ public virtual string GetEntityName(PEFile module, EntityHandle handle, bool ful

public virtual CodeMappingInfo GetCodeMappingInfo(PEFile module, SRM.EntityHandle member)
{
var parts = new Dictionary<SRM.MethodDefinitionHandle, SRM.MethodDefinitionHandle[]>();
var locations = new Dictionary<SRM.EntityHandle, SRM.MethodDefinitionHandle>();

var declaringType = member.GetDeclaringType(module.Metadata);

if (declaringType.IsNil && member.Kind == SRM.HandleKind.TypeDefinition) {
@@ -45,7 +45,6 @@ public override bool View(ViewModels.TabPageModel tabPage)
tabPage.SupportsLanguageSwitching = false;

var view = Helpers.PrepareDataGrid(tabPage, this);
var metadata = module.Metadata;

var list = new List<GenericParamEntry>();
GenericParamEntry scrollTargetEntry = default;
@@ -44,7 +44,6 @@ public override bool View(ViewModels.TabPageModel tabPage)
tabPage.SupportsLanguageSwitching = false;

var view = Helpers.PrepareDataGrid(tabPage, this);
var metadata = module.Metadata;

var list = new List<MethodImplEntry>();
MethodImplEntry scrollTargetEntry = default;
@@ -42,7 +42,6 @@ public override bool View(ViewModels.TabPageModel tabPage)
tabPage.SupportsLanguageSwitching = false;

var view = Helpers.PrepareDataGrid(tabPage, this);
var metadata = module.Metadata;

var list = new List<ModuleEntry>();
ModuleEntry scrollTargetEntry = default;
@@ -43,7 +43,6 @@ public override bool View(ViewModels.TabPageModel tabPage)
tabPage.SupportsLanguageSwitching = false;

var view = Helpers.PrepareDataGrid(tabPage, this);
var metadata = module.Metadata;

var list = new List<ParamEntry>();
ParamEntry scrollTargetEntry = default;
@@ -44,7 +44,6 @@ public override bool View(ViewModels.TabPageModel tabPage)
tabPage.SupportsLanguageSwitching = false;

var view = Helpers.PrepareDataGrid(tabPage, this);
var metadata = module.Metadata;

var list = new List<StandAloneSigEntry>();
StandAloneSigEntry scrollTargetEntry = default;
@@ -141,7 +141,6 @@ protected override void LoadChildren()
}
typeSystem = LoadedAssembly.GetTypeSystemOrNull(DecompilerTypeSystem.GetOptions(new DecompilationOptions().DecompilerSettings));
var assembly = (MetadataModule)typeSystem.MainModule;
var metadata = module.Metadata;
this.Children.Add(new Metadata.MetadataTreeNode(module, this));
Decompiler.DebugInfo.IDebugInfoProvider debugInfo = LoadedAssembly.GetDebugInfoOrNull();
if (debugInfo is Decompiler.PdbProvider.PortableDebugInfoProvider ppdb) {

0 comments on commit 2638af9

Please sign in to comment.
You can’t perform that action at this time.