Code review comment for lp:~cando/zeitgeist-datasources/fix_xchat

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Just a nitpick :-) Can you change this line:

  channel_list = g_slist_remove(channel_list, tmp->data);

to:

  channel_list = g_slist_delete_link(channel_list, tmp);

The way you do it now you do first a linear search for the data (the while(tmp) loop) and then another linear search to remove it with g_slist_remove(). Since you already have the link you wanna remove, you should use the O(1) function g_slist_delete_link() instead. But this is a nitpick ofcourse since the channels list isn't ever gonna be that big so it matters - but style is style right? :-)

In any case - approved. Nice work Stefano!

review: Approve

« Back to merge proposal