Revision d5a7d7f68fd2f50eec5a01df4ff01b1cace1319f

markdoliner at pidgin.im markdoliner at pidgin.im
Tue Mar 13 03:33:41 EDT 2007


o   -----------------------------------------------------------------
|   Revision: d5a7d7f68fd2f50eec5a01df4ff01b1cace1319f
|   Ancestor: d5a57d6d0c36d6bde39482305370d946584c9832
|   Author: markdoliner at pidgin.im
|   Date: 2007-03-13T07:19:06
|   Branch: im.pidgin.pidgin
|   
|   Modified files:
|           libpurple/protocols/jabber/roster.c
|           libpurple/protocols/jabber/si.c
|           libpurple/protocols/novell/nmuser.c
|           pidgin/gtkimhtmltoolbar.c
|           pidgin/plugins/musicmessaging/musicmessaging.c
|   
|   ChangeLog: 
|   
|   Don't use g_list_length() and g_slist_length() when all you want to
|   do if check if the list is empty.  Those two functions needlessly
|   iterate through the entire list.
|   
|   ============================================================
|   --- libpurple/protocols/jabber/roster.c	5a71828362fc4f322825fd8ad4f325854408ee17
|   +++ libpurple/protocols/jabber/roster.c	553be223e32c9bad69f81eda32fa6b8410962b94
|   @@ -380,7 +380,7 @@ void jabber_roster_remove_buddy(GaimConn
|    	GSList *groups = NULL;
|    
|    	buddies = g_slist_remove(buddies, buddy);
|   -	if(g_slist_length(buddies)) {
|   +	if(buddies != NULL) {
|    		GaimBuddy *tmpbuddy;
|    		GaimGroup *tmpgroup;
|    
|   ============================================================
|   --- libpurple/protocols/jabber/si.c	3e841ffef94bb5f5390710d86ada247bab5cc091
|   +++ libpurple/protocols/jabber/si.c	47d760130efc958d0bb131c2ad406ceeccab26b2
|   @@ -783,7 +783,7 @@ static void jabber_si_xfer_init(GaimXfer
|    			return;
|    
|    		/* XXX: for now, send to the first resource available */
|   -		if(g_list_length(jb->resources) >= 1) {
|   +		if(jb->resources != NULL) {
|    			char **who_v = g_strsplit(xfer->who, "/", 2);
|    			char *who;
|    
|   ============================================================
|   --- libpurple/protocols/novell/nmuser.c	702ebcd067b2391a9dfc48d26474bd2120d84950
|   +++ libpurple/protocols/novell/nmuser.c	f005ea2bb6b5b7c60f178579384a05ab54580414
|   @@ -1534,13 +1534,12 @@ _handle_multiple_get_details_joinconf_cb
|    		}
|    
|    		/* Time to callback? */
|   -		if (g_slist_length(list) == 0) {
|   +		if (list == NULL) {
|    			nm_response_cb cb = nm_request_get_callback(request);
|    
|    			if (cb) {
|    				cb(user, 0, conference, conference);
|    			}
|   -			g_slist_free(list);
|    			nm_release_request(request);
|    		}
|    	}
|   ============================================================
|   --- pidgin/gtkimhtmltoolbar.c	51de283d5c8966ce4a1998dbc6d8e3904f4c3562
|   +++ pidgin/gtkimhtmltoolbar.c	d84c3eab2623835189bd61dd7b3a1d924bb2c7d1
|   @@ -672,7 +672,7 @@ insert_smiley_cb(GtkWidget *smiley, GtkI
|    	gtk_window_set_role(GTK_WINDOW(dialog), "smiley_dialog");
|    	gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
|    
|   -	if (g_slist_length(unique_smileys)) {
|   +	if (unique_smileys != NULL) {
|    		struct smiley_button_list *ls, *it, *it_tmp;
|    		GtkWidget *line;
|    		int line_width = 0;
|   ============================================================
|   --- pidgin/plugins/musicmessaging/musicmessaging.c	6cae0b1bca6a24b5bb90dd8af1af797721f8a22a
|   +++ pidgin/plugins/musicmessaging/musicmessaging.c	de324a5a4ab466bc0967dacdc2ba1f8bf8f4272e
|   @@ -235,16 +235,19 @@ mmconv_from_conv_loc(GaimConversation *c
|    static int
|    mmconv_from_conv_loc(GaimConversation *conv)
|    {
|   +	GList *l;
|    	MMConversation *mmconv_current = NULL;
|    	guint i;
|    	
|   -	for (i = 0; i < g_list_length(conversations); i++)
|   +	i = 0;
|   +	for (l = conversations; l != NULL; l = l->next)
|    	{
|   -		mmconv_current = (MMConversation *)g_list_nth_data(conversations, i);
|   +		mmconv_current = l->data;
|    		if (conv == mmconv_current->conv)
|    		{
|    			return i;
|    		}
|   +		i++;
|    	}
|    	return -1;
|    }
|   @@ -295,9 +298,9 @@ plugin_unload(GaimPlugin *plugin) {
|    plugin_unload(GaimPlugin *plugin) {
|    	MMConversation *mmconv = NULL;
|    	
|   -	while (g_list_length(conversations) > 0)
|   +	while (conversations != NULL)
|    	{
|   -		mmconv = g_list_first(conversations)->data;
|   +		mmconv = conversations->data;
|    		conv_destroyed(mmconv->conv);
|    	}
|    	return TRUE;

To get the patch for this revision, please do this:
mtn log --last 1 --diffs --from d5a7d7f68fd2f50eec5a01df4ff01b1cace1319f


More information about the Commits mailing list