Mercurial > pidgin.yaz
diff pidgin/gtkrequest.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 | 862382aa6086 |
children | 17b840986607 9bdd3ab8087f 89b95d143116 |
line wrap: on
line diff
--- a/pidgin/gtkrequest.c Thu Nov 27 05:51:03 2008 +0000 +++ b/pidgin/gtkrequest.c Thu Nov 27 05:54:09 2008 +0000 @@ -853,12 +853,11 @@ create_choice_field(PurpleRequestField *field) { GtkWidget *widget; - GList *labels; + GList *labels = purple_request_field_choice_get_labels(field); + int num_labels = g_list_length(labels); GList *l; - labels = purple_request_field_choice_get_labels(field); - - if (g_list_length(labels) > 5) + if (num_labels > 5) { GtkWidget *menu; GtkWidget *item; @@ -892,7 +891,7 @@ GtkWidget *radio; gint i; - if (g_list_length(labels) == 2) + if (num_labels == 2) box = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); else box = gtk_vbox_new(FALSE, 0);