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

2019-09-29 Thread Junio C Hamano
CB Bailey writes: > For easier discussion, I've snipped the original patch and replaced with > one with enough context to show the entire function. > > I was reviewing this patch and it appeared to introduce a change in > behaviour. > >> diff --git a/diffcore-break.c b/diffcore-break.c >> index 8

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

2019-09-29 Thread Alex Henrie
On Sun, Sep 29, 2019 at 3:37 AM CB Bailey wrote: > > Previously, if the condition matched in the inner loop, the function > would null out the entry in the queue that that inner loop had reached > (q->queue[j] = NULL) and then break out of the inner loop. This meant > that the outer loop would ski

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

2019-09-29 Thread CB Bailey
On Sat, Sep 28, 2019 at 06:56:46PM -0600, Alex Henrie wrote: > 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 to the end of the loop with a jump to the end of the function. > > With the break rep

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

2019-09-28 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 to the end of the loop with a jump to the end of the function. With the break replaced by a goto, the two diff_q calls then can be replaced with a singl