[glade/composite-templates-new: 1/7] Sorting signals: g_list_sort() after the loop.



commit d5ea40b649be77740a3dd903bd965eeba964111e
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sun Mar 31 21:58:57 2013 +0900

    Sorting signals: g_list_sort() after the loop.

 gladeui/glade-widget.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 8c94a87..6dcddd8 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -3980,12 +3980,12 @@ glade_widget_write_signals (GladeWidget * widget,
        {
          signal = g_ptr_array_index (signals, i);
 
-         sorted_signals =
-           g_list_insert_sorted (sorted_signals,
-                                 signal, (GCompareFunc)signal_compare);
+         sorted_signals = g_list_prepend (sorted_signals, signal);
        }
     }
 
+  sorted_signals = g_list_sort (sorted_signals, (GCompareFunc)signal_compare);
+
   for (l = sorted_signals; l; l = l->next)
     {
          signal = l->data;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]