[Pidgin] #10891: gevolution plugin adds buddies to random account
Pidgin
trac at pidgin.im
Fri Sep 3 18:20:45 EDT 2010
#10891: gevolution plugin adds buddies to random account
-----------------------------------------+----------------------------------
Reporter: cedel | Owner:
Type: patch | Status: new
Milestone: Patches Needing Improvement | Component: plugins
Version: 2.6.3 | Resolution:
Keywords: |
-----------------------------------------+----------------------------------
Comment(by QuLogic):
Replying to [comment:13 cedel]:
> Replying to [comment:11 QuLogic]:
> > What is `changewin->selection` for? It does not appear to be used
outside of the function in which it is set, so why does it need to be
saved?
>
> Please, can you be more specific, on what line number? Cause if I look
at the last published version of the patch, I don't see it anywhere? But I
am sleepy now...
>
In `selected_account_cb` and `gevo_select_account_dialog`.
> > Using `g_list_length` to check if the list is 0, 1, or "many" is not
necessary. Just check `list` and `list->next`. Also, you call
`g_list_length` multiple times instead of using the cached value in `d`.
>
> True, but it seems more understandable this way (at least for me) and
debug gets fresh info if something happened (so g_list_length gets called
twice within the same function). But will check on this one again later.
It's less efficient that way. I don't know what you mean by "fresh info",
since the two `g_list_length` calls are in almost adjacent statements and
the list cannot change length between them.
Another instance is in `gevo_select_account_dialog`. You don't need to
check the list length if all you want to know is if there's more than one.
Also, if you reverse the condition, you could return from the function
right there and you wouldn't need all the indenting (since basically the
entire function is indented an extra tab).
--
Ticket URL: <http://developer.pidgin.im/ticket/10891#comment:15>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list