From ff1db7980c36b1ecd5d5aa40405e7f4aa5324d14 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Sat, 28 Jun 2008 17:06:06 +0000 Subject: [PATCH] 2008-06-28 Mike Kestner * gtk/TreeSelection.custom: use list marshaler to avoid O(n^2) copy from old custom code. [Fixes #404669] svn path=/trunk/gtk-sharp/; revision=106824 --- ChangeLog | 5 +++++ gtk/TreeSelection.custom | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c8cee57e..44f821f17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-28 Mike Kestner + + * gtk/TreeSelection.custom: use list marshaler to avoid O(n^2) + copy from old custom code. [Fixes #404669] + 2008-06-28 Mike Kestner * gtk/Gtk.metadata: mark a const string. [Fixes #404630] diff --git a/gtk/TreeSelection.custom b/gtk/TreeSelection.custom index b2f831c62..ea6377730 100644 --- a/gtk/TreeSelection.custom +++ b/gtk/TreeSelection.custom @@ -29,10 +29,7 @@ return new TreePath [0]; GLib.List list = new GLib.List (list_ptr, typeof (Gtk.TreePath)); - TreePath[] result = new TreePath [list.Count]; - for (int i = 0; i < list.Count; i++) - result [i] = (TreePath) list [i]; - return result; + return (TreePath[]) GLib.Marshaller.ListToArray (list, typeof (Gtk.TreePath)); } [DllImport("libgtk-win32-2.0-0.dll")] @@ -47,10 +44,7 @@ return new TreePath [0]; GLib.List list = new GLib.List (list_ptr, typeof (Gtk.TreePath)); - TreePath[] result = new TreePath [list.Count]; - for (int i = 0; i < list.Count; i++) - result [i] = (TreePath) list [i]; - return result; + return (TreePath[]) GLib.Marshaller.ListToArray (list, typeof (Gtk.TreePath)); } [Obsolete ("Replaced by SelectFunction property.")]