[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

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

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

2013-08-08 Thread Stefan Beller
ternary expression always evaluating to true 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

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

2013-08-08 Thread Philip Oakley
From: Stefan Beller stefanbel...@googlemail.com 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

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 (but not

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

2013-08-08 Thread Junio C Hamano
Johannes Schindelin johannes.schinde...@gmx.de 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