Browse Source

Replace variable name for integers with "i", "j", "k", etc...

pull/1/head^2
David Srbecký 18 years ago
parent
commit
5b48611b69
  1. 9
      src/AstMetodBodyBuilder.cs

9
src/AstMetodBodyBuilder.cs

@ -38,7 +38,16 @@ namespace Decompiler @@ -38,7 +38,16 @@ namespace Decompiler
MethodBodyGraph bodyGraph = new MethodBodyGraph(exprCollection);
bodyGraph.Optimize();
List<string> intNames = new List<string>(new string[] {"i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t"});
foreach(VariableDefinition varDef in methodDef.Body.Variables) {
if (varDef.VariableType.FullName == Cecil.Constants.Int32 &&
varDef.Name.StartsWith("V_") &&
intNames.Count > 0)
{
varDef.Name = intNames[0];
intNames.RemoveAt(0);
}
localVarTypes[varDef.Name] = varDef.VariableType;
localVarDefined[varDef.Name] = false;

Loading…
Cancel
Save