From 3d6decbd0d56476b2307d8447cb0ad3ed7df60b8 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 4 Nov 2012 16:29:40 +0100 Subject: [PATCH] generator: Use List in generated constructors This makes the generated code a bit nicer, but has no impact outside of the generated constructors. --- generator/Ctor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generator/Ctor.cs b/generator/Ctor.cs index 3fe0c842c..9747b23d4 100644 --- a/generator/Ctor.cs +++ b/generator/Ctor.cs @@ -123,8 +123,8 @@ namespace GtkSharp.Generation { } if (names.Count == Parameters.Count) { - sw.WriteLine ("\t\t\t\tArrayList vals = new ArrayList();"); - sw.WriteLine ("\t\t\t\tArrayList names = new ArrayList();"); + sw.WriteLine ("\t\t\t\tvar vals = new List ();"); + sw.WriteLine ("\t\t\t\tvar names = new List ();"); for (int i = 0; i < names.Count; i++) { Parameter p = Parameters [i]; string indent = "\t\t\t\t"; @@ -139,7 +139,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\t\t\t}"); } - sw.WriteLine ("\t\t\t\tCreateNativeObject ((string[])names.ToArray (typeof (string)), (GLib.Value[])vals.ToArray (typeof (GLib.Value)));"); + sw.WriteLine ("\t\t\t\tCreateNativeObject (names.ToArray (), vals.ToArray ());"); sw.WriteLine ("\t\t\t\treturn;"); } else sw.WriteLine ("\t\t\t\tthrow new InvalidOperationException (\"Can't override this constructor.\");");