Daniel Gustafsson <dan...@yesql.se> writes:
>> On 2 Sep 2022, at 14:57, Tom Lane <t...@sss.pgh.pa.us> wrote:
>> I noticed the same thing, but sticking the CFI immediately after the
>> declaration didn't read well either.  I was considering moving it to
>> the bottom of the loop instead of that.  

> I was contemplating that too, but kept it at the top after seeing quite a few
> examples of that in other contrib modules (like amcheck/verify_nbtree.c and
> pg_visibility/pg_visibility.c).  I don't have any strong feelings either way,
> I'm happy to move it last.

You could keep it at the top, but then I'd be inclined to split up
the existing code:

        int            trgindex;

        CHECK_FOR_INTERRUPTS();

        /* Get index of next trigram */
        trgindex = trg2indexes[i];

        /* Update last position of this trigram */
        ...

What's annoying me about the one-liner fix is that it makes it
look like CFI is part of the "Get index" action.

                        regards, tom lane


Reply via email to