[empathy/gnome-3-8] menu_removed_cb: call g_menu_model_get_n_items() once
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-3-8] menu_removed_cb: call g_menu_model_get_n_items() once
- Date: Fri, 15 Nov 2013 12:58:27 +0000 (UTC)
commit dda3f6c4ee2e695dbc111023dc9fa7fa53ab4827
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 8280861..5b4e987 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -1341,10 +1341,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]