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

Re: [PATCH] rebase: clarify conditionals in todo_list_to_strbuf()

From
Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Date
Mar 24, 2023, 08:59 UTC
Message-ID
<ZB1miMcYWXWBvGbm@ugly>
In-Reply-To
<ZBy3aa+7RhnjJUaG@nand.local>
On Thu, Mar 23, 2023 at 04:32:41PM -0400, Taylor Blau wrote:
Show 11 quoted lines
>I dunno. I think seeing adjacent
>
>    if (item->command == TODO_ABC)
>
>and
>
>    if (item->command == TODO_XYZ)
>
>makes it clear that these two are mutually exclusive, since TODO_ABC !=
>TODO_XYZ.
>

no, because you have to prove to yourself that the queried value doesn't change in between. and so does the compiler, which may fail to tail-merge the embedded strbuf_addstr() calls as a consequence.

>Specifically: why not combine these two with if-statement that proceeds
>it? That might look something like: [...]
>

i don't see what you're referring to, so i guess you got confused about the location of the code in question?

Previous: Taylor BlauNext: Phillip Wood
Message 3 of 14 in “rebase: clarify conditionals in todo_list_to_strbuf()”
  1. rebase: clarify conditionals in todo_list_to_strbuf()Oswald Buddenhagen, Mar 23, 2023
  2. Taylor BlauMar 23, 2023
  3. Oswald BuddenhagenMar 24, 2023
  4. Phillip WoodMar 24, 2023
  5. rebase: clarify conditionals in todo_list_to_strbuf()Oswald Buddenhagen, Apr 28, 2023
  6. Felipe ContrerasMay 2, 2023
  7. rebase: clarify conditionals in todo_list_to_strbuf()Oswald Buddenhagen, Aug 7, 2023
  8. Junio C HamanoAug 7, 2023
  9. Oswald BuddenhagenAug 9, 2023
  10. Junio C HamanoAug 9, 2023
  11. Oswald BuddenhagenAug 10, 2023
  12. Junio C HamanoAug 10, 2023
  13. Oswald BuddenhagenAug 11, 2023
  14. Richard KerryAug 11, 2023

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.