Re: [PATCH] fib-trie: code cleanup (v2)

From: Stephen Hemminger
Date: Tue Dec 08 2009 - 14:28:56 EST


On Tue, 8 Dec 2009 14:25:09 -0500
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx> wrote:

> * Stephen Hemminger (shemminger@xxxxxxxxxxxxxxxxxxxx) wrote:
> > On Tue, 8 Dec 2009 13:48:39 -0500
> > Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx> wrote:
> >
> > > /* use cache location of last found key */
> > > - if (iter->pos > 0 && pos >= iter->pos && (l = fib_find_node(t, iter->key)))
> > > - pos -= iter->pos;
> > > + if (iter->pos > 0 && pos >= iter->pos)
> > > + l = fib_find_node(t, iter->key);
> > > + if (l)
> > > + pos -= iter->pos;
> > > else {
> >
> > Missing bracket's here change the semantics.
>
> Ouch, yes. thanks.
>
>

The original code works and was clean enough, to split the assignment
out would require duplicate code.

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/