From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26099 invoked by alias); 6 Jan 2015 10:45:03 -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: 34133 Received: (qmail 16681 invoked from network); 6 Jan 2015 10:45:01 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 From: Kamil Dudka To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: Re: PATCH 06/17: compctl: Remove pointless check Date: Tue, 06 Jan 2015 10:43:03 +0100 Message-ID: <2802681.bPY3VCd1lN@kdudka.brq.redhat.com> User-Agent: KMail/4.14.3 (Linux/3.17.7-300.fc21.x86_64; KDE/4.14.3; x86_64; ; ) In-Reply-To: <150105235302.ZM10839@torch.brasslantern.com> References: <1420521949-30483-1-git-send-email-mikachu@gmail.com> <1420521949-30483-7-git-send-email-mikachu@gmail.com> <150105235302.ZM10839@torch.brasslantern.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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