Re: [PATCH 03/12] xmerge.c: minimum readability fixups
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 30, 2008, 15:42 UTC
- Message-ID
- <7vk5dy1pc9.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0808301130250.24820@pacific.mpi-cbg.de.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 16 quoted lines
>> @@ -449,12 +449,11 @@ static int xdl_do_merge(xdfenv_t *xe1, xdchange_t *xscr1, const char *name1,
>> chg0 = xscr1->i1 + xscr1->chg1 - i0;
>> chg1 = xscr1->i2 + xscr1->chg2 - i1;
>> chg2 = xscr2->i2 + xscr2->chg2 - i2;
>> - if (ffo > 0)
>> - chg2 += ffo;
>> - else {
>> + if (ffo < 0) {
>> chg0 -= ffo;
>> chg1 -= ffo;
>> - }
>> + } else
>> + chg2 += ffo;
>
> I do not understand why the order was changed, but hey, I do not care that
> deeply.Everywhere else the code deals with variables var0, var1 and var2 in this order, and that is because "if" blocks are consistently about changes made on side#1 while "else" blocks are about changes made on side#2. This statement alone was inconsistent, and now it all reads 0, 1 and then 2.