Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Dec 2000 18:18:52 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.ORG>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: Current hangs...
Message-ID:  <XFMail.001231181852.jhb@FreeBSD.org>
In-Reply-To: <200101010204.f0124oW47215@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 01-Jan-01 Matt Dillon wrote:
>:
>:Why not this:
>:
>:s = splbio();
>:TAILQ_FOREACH(bp, &vp->v_dirtyblkhd, b_vnbufs) {
> 
>     First rule when making simple bug fixes by copying working code from one
>     source file to another is:  Dont try to optimize the code on the
>     fly.

That works.

>     Personally speaking, I don't find the FOREACH macros any more readable
>     vs an explicit for loop.  They hide too much... like for example the
>     fact that you are dependant on the current pointer remaining valid to
>     get the next pointer in the loop.

Erm, I find one succint line easier to read than something sprawled across 2-3
lines of code.  Also, I was never under the assumption that you could do a
*_FOREACH() loop while the list changed out from under you.  I doubt anyone
else is either. :)

>                                       -Matt

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.001231181852.jhb>