Mercurial > pidgin.yaz
diff pidgin/gtkblist.c @ 24497:f10aba5592c6
The other day while struct hiding, I noticed a for loop that was checking
g_list_length() as the loop conditional. I decided to check all our calls
to g_list_length() to see which ones I could clean up without too much work.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Thu, 27 Nov 2008 05:54:09 +0000 |
parents | 558523cebd10 |
children | 125cac3e24ee fdd9fd5c2086 9bdd3ab8087f 25e2ab1fff1d a063901a5499 89b95d143116 |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Thu Nov 27 05:51:03 2008 +0000 +++ b/pidgin/gtkblist.c Thu Nov 27 05:54:09 2008 +0000 @@ -3320,6 +3320,7 @@ if (PURPLE_BLIST_NODE_IS_CHAT(node)) { PurpleChat *chat; + GList *connections; GList *cur; struct proto_chat_entry *pce; char *name, *value; @@ -3330,7 +3331,8 @@ prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account)); prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if (g_list_length(purple_connections_get_all()) > 1) + connections = purple_connections_get_all(); + if (connections && connections->next) { tmp = g_markup_escape_text(chat->account->username, -1); g_string_append_printf(str, _("<b>Account:</b> %s"), tmp); @@ -3400,6 +3402,7 @@ PurpleBuddy *b; PurplePresence *presence; PurpleNotifyUserInfo *user_info; + GList *connections; char *tmp; time_t idle_secs, signon; @@ -3421,7 +3424,8 @@ user_info = purple_notify_user_info_new(); /* Account */ - if (full && g_list_length(purple_connections_get_all()) > 1) + connections = purple_connections_get_all(); + if (full && connections && connections->next) { tmp = g_markup_escape_text(purple_account_get_username( purple_buddy_get_account(b)), -1);