Re: [PATCH v2 08/10] compat/regex: explicitly mark intentional use of the comma operator
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 27, 2025, 10:29 UTC
- Message-ID
- <1c8a3d80-5817-1e2a-de8c-06046d372fea@gmx.de>
- In-Reply-To
- <Z+RlEwwTvFkUWwkT@nand.local>
Hi Taylor,
On Wed, 26 Mar 2025, Taylor Blau wrote:
Show 18 quoted lines
> On Tue, Mar 25, 2025 at 11:32:12PM +0000, Johannes Schindelin via GitGitGadget wrote:
> > diff --git a/compat/regex/regex_internal.c b/compat/regex/regex_internal.c
> > index ec5cc5d2dd1..7672583bf7e 100644
> > --- a/compat/regex/regex_internal.c
> > +++ b/compat/regex/regex_internal.c
> > @@ -1231,9 +1231,10 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
> > for (sbase = dest->nelem + 2 * src->nelem,
> > is = src->nelem - 1, id = dest->nelem - 1; is >= 0 && id >= 0; )
> > {
> > - if (dest->elems[id] == src->elems[is])
> > - is--, id--;
> > - else if (dest->elems[id] < src->elems[is])
> > + if (dest->elems[id] == src->elems[is]) {
> > + is--;
> > + id--;
> > + } else if (dest->elems[id] < src->elems[is])
>
> Should the other arms of this conditional have matching curly-braces?No. Have a look around in that file, that's not the coding convention.
However, a valid concern is that I used Git's convention for the curly brackets (appending the open bracket to the `if` line), which is _not_ the convention used in this file, which uses GNU conventions instead. I will address that concern in the next iteration.
Ciao, Johannes