[empathy] 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] menu_removed_cb: call g_menu_model_get_n_items() once
- Date: Wed, 25 Sep 2013 13:29:41 +0000 (UTC)
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]