Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: bgpd: use FOREACH_SAFE instead of handrolling it
To:
tech@openbsd.org
Date:
Wed, 12 Feb 2025 17:44:28 +0100

Download raw body.

Thread
On Wed, Feb 12, 2025 at 05:12:41PM +0100, Claudio Jeker wrote:
> In most cases we use the FOREACH_SAFE iterator with the various queues
> when needed but some old code still used the explicit for loop.
> This changes those.
> 
> The changes in name2id.c are less obvious. In _unref() using FOREACH_SAFE
> is actually not really needed (since we break out before using the next
> element).

Right. Made it easier to review, though.

> In _name2id the construct is impossible to read and I think the
> new form is hopefully easier to read.

Yes, the new version is much better.

> Two loops are left, one in rde.c and one in rde_filter.c which are so
> special that I don't want to change them.

Agreed.

ok