From owner-svn-src-all@FreeBSD.ORG Mon Mar 28 23:12:38 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id D0B9A1065672; Mon, 28 Mar 2011 23:12:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id EBA1014DF0A; Mon, 28 Mar 2011 23:12:37 +0000 (UTC) Message-ID: <4D9115E5.3040008@FreeBSD.org> Date: Mon, 28 Mar 2011 16:12:37 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110319 Thunderbird/3.1.9 MIME-Version: 1.0 To: Warner Losh References: <201103271657.p2RGvs2m063692@svn.freebsd.org> <4D8F7257.50207@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Josh Paetzel , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, kib@FreeBSD.org Subject: Re: svn commit: r220059 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2011 23:12:38 -0000 On 03/27/2011 15:29, Warner Losh wrote: > > On Mar 27, 2011, at 11:22 AM, Doug Barton wrote: > >> On 03/27/2011 09:57, Josh Paetzel wrote: >>> Replace "$?" = "0" with $? -eq 0 in tests >> >> Excellent! > > Most of the time I've found that moving the command up to the if makes the code clearer too. At jobs I've had in the past when I've written code similar to what we have here, it almost always got flagged... In general I agree with you. I did take a look at the specific cases where the -eq 0 changes were made and IMO it's about 50/50 whether that would actually be an optimization, or if leaving it as is makes the code more readable. I chose to go with "focus on the positive." :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/