[empathy] menu_removed_cb: call g_menu_model_get_n_items() once



commit ff897a9a71c4eb91548f40ab6ea09e17936cd8c1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Sep 11 16:24:42 2013 +0200

    menu_removed_cb: call g_menu_model_get_n_items() once
    
    No need to call it during each iteration.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707885

 src/empathy-roster-window.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index 018e220..9dd7a4e 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -1354,10 +1354,11 @@ roster_window_favorite_chatroom_menu_removed_cb (
     EmpathyRosterWindow *self)
 {
   GList *chatrooms;
-  gint i;
+  guint i, n;
 
-  for (i = 0; i < g_menu_model_get_n_items (
-        G_MENU_MODEL (self->priv->rooms_section)); i++)
+  n = g_menu_model_get_n_items (G_MENU_MODEL (self->priv->rooms_section));
+
+  for (i = 0; i < n; i++)
     {
       const gchar *name;
 


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