git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Sep 29, 2019, 20:10 UTC
Message-ID
<CAMMLpeQnVb1M_Wy_GDeH44YVweXvNQ2jpyJqtvJ4zS_fGfxKuw@mail.gmail.com>
In-Reply-To
<20190929093706.ylm5dsftwl2y2nnz@hashpling.org>
On Sun, Sep 29, 2019 at 3:37 AM CB Bailey <cb@hashpling.org> wrote:
Show 11 quoted lines
>
> 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 skip over this entry (if (!p)).
>
> The change introduced seems to break out of both loops as soon as we
> reach one match, whereas before other subsequent matches would be
> considered and merged. Not only this, but the outer 'else' case for all
> subsequent entries is skipped so the rest of the entries the original
> queue are missing from 'outq'.
> I spent a bit of time trying to see if this change was user visible
> which turned out to be unneeded as t4008-diff-break-rewrite.sh already
> fails with this change for me in my environment, initially with this
> test but also 3 other tests in this file.

Thank you for reviewing this. I should have run `make test` myself before sending the patch; I do indeed see the same test failure that you saw. I will send a v4 of this patch with the label in the right place.

-Alex
Previous: CB BaileyNext: Junio C Hamano
Message 3 of 4 in “diffcore-break: use a goto instead of a redundant if statement”
  1. diffcore-break: use a goto instead of a redundant if statementAlex Henrie, Sep 29, 2019
  2. CB BaileySep 29, 2019
  3. Alex HenrieSep 29, 2019
  4. Junio C HamanoSep 30, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.