On Mon, Mar 5, 2018 at 11:09 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes: > >> On Sat, Mar 03 2018, Jeff King jotted: >> >>> + if (@colored && @colored != @diff) { >> >> nit: should just be: >> >> if (@colored != @diff) { >> >> It's not possible for @arrays in scalar context to be undefined. > > It is true that @array can not be undef, but your rewrite I think is > wrong. > > The first "do the comparison only @colored is true" is not about > definedness. It is "@colored can be an empty array when the user is > not using separate 'show these colored lines to the end user, feed > these noncolored lines to git-apply command' feature, so @colored==0 > and @diff > 0 is perfectly fine". Yes, sorry for the noise. I misread the intent of the code.