Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2007 15:50:07 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        arch@FreeBSD.org
Subject:   Re: Code review request: small optimization to localtime.c
Message-ID:  <86lk8hhzs0.fsf@ds4.des.no>
In-Reply-To: <20071128.151021.709401576.imp@bsdimp.com> (M. Warner Losh's message of "Wed\, 28 Nov 2007 15\:10\:21 -0700 \(MST\)")
References:  <20071128.151021.709401576.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"M. Warner Losh" <imp@bsdimp.com> writes:
> Please find enclosed some small optimizations.  [...]

almost completely unrelated, but while you're at it:

>  	if (__isthreaded !=3D 0) {

__isthreaded is clearly (by its name) a predicate, comparing it
explicitly to 0 is redundant and disrupts my flow of thought when
reading the code.  Instead of just reading "if is threaded", I have to
take a second to parse the expression and check which way the comparison
goes.

We already have a policy (unwritten as far as I know) of using explicit
comparisons for variables which are not clearly predicates, can we also
have one of *not* using explicit comparisons for those that are?  And
document both cases in style(9)?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86lk8hhzs0.fsf>