Re: [PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Stefan Beller
On 08/08/2013 11:36 PM, Philip Oakley wrote: > From: "Stefan Beller" > Sent: Thursday, August 08, 2013 7:55 PM > Subject: [PATCH] diff: remove another ternary expression always > evaluating to true > > Have these issues (and the earlier expression simplifications pat

Re: [PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Junio C Hamano
Johannes Schindelin writes: > Hi Stefan, > > On Thu, 8 Aug 2013, Stefan Beller wrote: > >> So you rather propose to have >> -show_submodule_summary(o->file, one ? one->path : two->path, >> +show_submodule_summary(o->file, one->path ? one->path : >> two->path, > > I do. T

Re: [PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Johannes Schindelin
Hi Stefan, On Thu, 8 Aug 2013, Stefan Beller wrote: > So you rather propose to have > - show_submodule_summary(o->file, one ? one->path : two->path, > + show_submodule_summary(o->file, one->path ? one->path : > two->path, I do. The reason is that one->path could be NULL

Re: [PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Philip Oakley
From: "Stefan Beller" Sent: Thursday, August 08, 2013 7:55 PM Subject: [PATCH] diff: remove another ternary expression always evaluating to true Have these issues (and the earlier expression simplifications patches $gmane/231916, $gmane/231912 ) been discovered with the "

Re: [PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Stefan Beller
) Stefan --8<-- From 3a580c51f0bf70745f26eb5045d646dfead2afd3 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Thu, 8 Aug 2013 20:54:24 +0200 Subject: [PATCH] diff: remove another ternary expression always evaluating to true The condition before the changed line dereferences 'one&#

Re: [PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Johannes Schindelin
Hi Stefan, On Thu, 8 Aug 2013, Stefan Beller wrote: > The condition before the changed line dereferences 'one' to query the mode, > so if the condition evaluates to true, the variable one must not be null. To show this better, please use -U10 (or some other appropriate context option) in the fut

[PATCH] diff: remove another ternary expression always evaluating to true

2013-08-08 Thread Stefan Beller
The condition before the changed line dereferences 'one' to query the mode, so if the condition evaluates to true, the variable one must not be null. Therefore we do not need the ternary operator depending on one, giving either one->path or two->path. This always evaluates to one->path, so we can r