Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jb@evain.net>2016-07-21 21:20:41 +0300
committerJb Evain <jb@evain.net>2016-07-21 21:20:41 +0300
commit64c70936bf0fa2a83ec0c2a85851e0d187fb451e (patch)
tree958f94b23c74de025438a6083a93477049cbae1a
parent73bde3b6255152dd3d3d87baabb5739380bfd9ec (diff)
Make AssertCode use the new TryGetName for variables
-rw-r--r--Test/Mono.Cecil.Tests/Formatter.cs7
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 ();
}