From 88b67c42ca8b7d58141c176b46749819bfcef166 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 15 Mar 2017 16:24:13 -0400 Subject: Avoid using a c#7 local method. --- TableDumper.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/TableDumper.cs b/TableDumper.cs index 0366f3c..bfb69cc 100644 --- a/TableDumper.cs +++ b/TableDumper.cs @@ -177,6 +177,15 @@ namespace Ildasm } } + string StringifyCattrValue (object val) { + if (val.GetType () == typeof (string)) + return String.Format ("\"{0}\"", val); + else if (val == null) + return "null"; + else + return val.ToString (); + } + void DumpCustomAttributeTable (TextWriter w) { var t = module.CustomAttribute; w.WriteLine ("CustomAttribute Table (1.." + t.RowCount + ")"); @@ -206,15 +215,6 @@ namespace Ildasm { GenericParamTable.Index, "GenericParam" } }; - string StringifyCattrValue (object val) { - if (val.GetType () == typeof (string)) - return String.Format ("\"{0}\"", val); - else if (val == null) - return "null"; - else - return val.ToString (); - } - foreach (var cattr in module.__EnumerateCustomAttributeTable ()) { //Console.WriteLine (cattr); @@ -228,7 +228,6 @@ namespace Ildasm var args = new StringBuilder (); args.Append ("["); - bool first_arg = true; var sep = ""; foreach (var arg in cattr.ConstructorArguments) { args.Append (sep).Append (StringifyCattrValue (arg.Value)); -- cgit v1.2.3