Re: [PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-10-01 Thread Junio C Hamano
Alex Henrie writes: > On Mon, Sep 30, 2019 at 3:48 AM Junio C Hamano wrote: >> >> Alex Henrie writes: >> >> > Well, I admit that code clarity is somewhat subjective. To me it's not >> > obvious that "if (q->nr <= j)" means "if the loop exited normally", I agree that it is subjective, but "if c

Re: [PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-30 Thread Alex Henrie
On Mon, Sep 30, 2019 at 3:48 AM Junio C Hamano wrote: > > Alex Henrie writes: > > > Well, I admit that code clarity is somewhat subjective. To me it's not > > obvious that "if (q->nr <= j)" means "if the loop exited normally", > > I actually do not have too much problem with this side of the > eq

Re: [PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-30 Thread Junio C Hamano
Alex Henrie writes: > Well, I admit that code clarity is somewhat subjective. To me it's not > obvious that "if (q->nr <= j)" means "if the loop exited normally", I actually do not have too much problem with this side of the equation. I however do see problem with squashing the two diff_q calls

Re: [PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-30 Thread Alex Henrie
On Sun, Sep 29, 2019 at 7:36 PM Junio C Hamano wrote: > > Alex Henrie writes: > > > The condition "if (q->nr <= j)" checks whether the loop exited normally > > or via a break statement. This check can be avoided by replacing the > > jump out of the inner loop with a jump to the end of the outer l

Re: [PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread Junio C Hamano
Alex Henrie writes: > The condition "if (q->nr <= j)" checks whether the loop exited normally > or via a break statement. This check can be avoided by replacing the > jump out of the inner loop with a jump to the end of the outer loop. > > With the break replaced by a goto, the two diff_q calls t

[PATCH v4] diffcore-break: use a goto instead of a redundant if statement

2019-09-29 Thread Alex Henrie
The condition "if (q->nr <= j)" checks whether the loop exited normally or via a break statement. This check can be avoided by replacing the jump out of the inner loop with a jump to the end of the outer loop. With the break replaced by a goto, the two diff_q calls then can be replaced with a sing