From owner-svn-src-head@FreeBSD.ORG Tue Nov 22 20:27:37 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0531A106564A; Tue, 22 Nov 2011 20:27:37 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 63F108FC13; Tue, 22 Nov 2011 20:27:36 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAMKRZvr021687; Tue, 22 Nov 2011 15:27:35 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAMKRZ6Q021686; Tue, 22 Nov 2011 15:27:35 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Tue, 22 Nov 2011 15:27:35 -0500 From: David Schultz To: Eitan Adler Message-ID: <20111122202735.GA21442@zim.MIT.EDU> Mail-Followup-To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, bde@freebsd.org, theraven@freebsd.org, dim@freebsd.org, Brooks Davis References: <201111220250.pAM2oPWC070856@svn.freebsd.org> <20111122153332.GA20145@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: src-committers@FreeBSD.ORG, theraven@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, dim@FreeBSD.ORG, Brooks Davis , bde@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r227812 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 20:27:37 -0000 On Tue, Nov 22, 2011, Eitan Adler wrote: > The problem with profiling this type of change is that it is hard to > find a good representative benchmark. I could easily write code that > will show you that adding the equality check is a good idea or that it > is a horrible idea. IMHO it saves enough time when they are equal, but > loses almost no time when the strings are not equal. Benchmark or not, I think you'll have a very hard time finding a single real program that routinely calls strcasecmp() with identical pointers! > Here is what I'd like to do next: > > - fix bde@'s style nits > - change the | to a || and remove the comment > - but leave the equality check as is. > - find a src committer to approve the patch > - go back to working on ports for a while ;) > > Is this the right course of action? Or should I just revert both > commits entirely? Fixing the style nits would be good, and it sounds like several people are in favor of using boolean operators to combine boolean expressions. I don't think the extra tests you added make much difference either way, but I wouldn't want to see even more special cases sprinkled throughout the source tree without some validation that shows they are helpful. You shouldn't let this discourage you from working on src in the future. Not everyone is going to agree with everything you want to change. One observation: The level of nit-picking tends to be inversely proportional to the size of the change you're making. In other words, if you put a lot of effort into a really significant improvement, then it's *your* code and people are less likely to bother you about the details.