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?