Code review request: small optimization to localtime.c

M. Warner Losh imp at bsdimp.com
Thu Nov 29 07:41:32 PST 2007


In message: <86lk8hhzs0.fsf at ds4.des.no>
            Dag-Erling_Smørgrav <des at des.no> writes:
: "M. Warner Losh" <imp at bsdimp.com> writes:
: > Please find enclosed some small optimizations.  [...]
: 
: almost completely unrelated, but while you're at it:
: 
: >  	if (__isthreaded != 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)?

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


More information about the freebsd-arch mailing list