From owner-freebsd-arch@FreeBSD.ORG Thu Nov 29 15:41:32 2007 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49EB716A469 for ; Thu, 29 Nov 2007 15:41:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 10E6313C4EF for ; Thu, 29 Nov 2007 15:41:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lATFcGYb011116; Thu, 29 Nov 2007 08:38:16 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 29 Nov 2007 08:41:08 -0700 (MST) Message-Id: <20071129.084108.-713549098.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <86lk8hhzs0.fsf@ds4.des.no> References: <20071128.151021.709401576.imp@bsdimp.com> <86lk8hhzs0.fsf@ds4.des.no> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arch@FreeBSD.org Subject: Re: Code review request: small optimization to localtime.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2007 15:41:32 -0000 In message: <86lk8hhzs0.fsf@ds4.des.no> Dag-Erling_Sm=F8rgrav writes: : "M. Warner Losh" 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