diff options
author | Jb Evain <jb@evain.net> | 2016-07-21 21:20:41 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2016-07-21 21:20:41 +0300 |
commit | 64c70936bf0fa2a83ec0c2a85851e0d187fb451e (patch) | |
tree | 958f94b23c74de025438a6083a93477049cbae1a | |
parent | 73bde3b6255152dd3d3d87baabb5739380bfd9ec (diff) |
Make AssertCode use the new TryGetName for variables
-rw-r--r-- | Test/Mono.Cecil.Tests/Formatter.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Test/Mono.Cecil.Tests/Formatter.cs b/Test/Mono.Cecil.Tests/Formatter.cs index 7c8c76a..1af56df 100644 --- a/Test/Mono.Cecil.Tests/Formatter.cs +++ b/Test/Mono.Cecil.Tests/Formatter.cs @@ -63,10 +63,9 @@ namespace Mono.Cecil.Tests { static string GetVariableName (VariableDefinition variable, MethodBody body) { - foreach (var scope in body.Method.DebugInformation.GetScopes ()) - foreach (var variable_symbol in scope.Variables) - if (variable_symbol.Index == variable.Index) - return variable_symbol.Name; + string name; + if (body.Method.DebugInformation.TryGetName (variable, out name)) + return name; return variable.ToString (); } |