On Tue, 2010-05-25 at 15:48 +0200, Niemi Aki (Nokia-D/Helsinki) wrote:
> Let's refactor this. It's not obvious why we need both these for loops.
> How about something like this instead:
> 
> >       struct ofono_atom *atom;
> >       GSList *l = modem->atoms;
> >       GSList *next;
> >
> >       for (l = modem->atoms; l; l = next) {
> >
> >               atom = l->data;
> >               next = l->next;
> >
> >               if (atom->modem_state > new_state)
> >                       continue;

Hmm... This probably should've been:

if (atom->modem_state <= new_state)
        continue;

Cheers,
Aki

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to