From owner-freebsd-arch@FreeBSD.ORG Thu Nov 29 15:07:50 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 EE0DC16A46C for ; Thu, 29 Nov 2007 15:07:50 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id B70A513C461 for ; Thu, 29 Nov 2007 15:07:50 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 038D42095; Thu, 29 Nov 2007 15:50:08 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.1/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id EAF892094; Thu, 29 Nov 2007 15:50:07 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id B473884498; Thu, 29 Nov 2007 15:50:07 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "M. Warner Losh" References: <20071128.151021.709401576.imp@bsdimp.com> Date: Thu, 29 Nov 2007 15:50:07 +0100 In-Reply-To: <20071128.151021.709401576.imp@bsdimp.com> (M. Warner Losh's message of "Wed\, 28 Nov 2007 15\:10\:21 -0700 \(MST\)") Message-ID: <86lk8hhzs0.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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:07:51 -0000 "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 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