Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2007 08:41:08 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        des@des.no
Cc:        arch@FreeBSD.org
Subject:   Re: Code review request: small optimization to localtime.c
Message-ID:  <20071129.084108.-713549098.imp@bsdimp.com>
In-Reply-To: <86lk8hhzs0.fsf@ds4.des.no>
References:  <20071128.151021.709401576.imp@bsdimp.com> <86lk8hhzs0.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <86lk8hhzs0.fsf@ds4.des.no>
            Dag-Erling_Sm=F8rgrav <des@des.no> writes:
: "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 t=
o
: take a second to parse the expression and check which way the compari=
son
: goes.
: =

: We already have a policy (unwritten as far as I know) of using explic=
it
: comparisons for variables which are not clearly predicates, can we al=
so
: have one of *not* using explicit comparisons for those that are?  And=

: document both cases in style(9)?

True, but very Brucian in the nature of the comment: I didn't change
this in existing code. :-)

I'll take a look at this sort of thing as well.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071129.084108.-713549098.imp>