From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24649 invoked by alias); 6 Jan 2015 16:20:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34141 Received: (qmail 11648 invoked from network); 6 Jan 2015 16:20:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=T/C1EZ6Q c=1 sm=1 tr=0 a=NYw9n4Tdrf7SEJJZV1QB5Q==:117 a=NYw9n4Tdrf7SEJJZV1QB5Q==:17 a=Hpgzp-inWqAA:10 a=N659UExz7-8A:10 a=xw0qIOHE-O3f6y4Ev_cA:9 a=pILNOxqGKmIA:10 Message-id: <54AC0B2D.9060006@eastlink.ca> Date: Tue, 06 Jan 2015 08:19:57 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-version: 1.0 To: zsh-workers@zsh.org Subject: Re: PATCH 06/17: compctl: Remove pointless check References: <1420521949-30483-1-git-send-email-mikachu@gmail.com> <1420521949-30483-7-git-send-email-mikachu@gmail.com> <150105235302.ZM10839@torch.brasslantern.com> <2802681.bPY3VCd1lN@kdudka.brq.redhat.com> In-reply-to: <2802681.bPY3VCd1lN@kdudka.brq.redhat.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 01/06/2015 01:43 AM, Kamil Dudka wrote: > On Monday 05 January 2015 23:53:02 Bart Schaefer wrote: >> On Jan 6, 6:25am, Mikael Magnusson wrote: >> } Subject: PATCH 06/17: compctl: Remove pointless check >> } >> } cc has already been derefed a bunch of times leading up to here. Found >> } by Coverity (Issue 1255841). >> } - if (cc && cc->xor) { >> } + if (cc->xor) { >> >> I'm curious, why bother to "fix" this (and a couple of similar others in >> later patches in this series)? It's not *wrong*, and the change is not >> a significant optimization. > True, modern compilers would optimize out such checks anyway in some cases. > Nevertheless, I believe that putting it explicit makes the code easier to > understand for a human reader. > > Kamil > Myself, if I saw some code that appeared pointless, I would sit there staring at it until I educated myself as to why it was there, because I wouldn't expect that pointless code would ever be tolerated.