Re: [PATCH] Add tests for Bitmapset - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Add tests for Bitmapset
Date
Msg-id aOcwU_0-U3zbNDki@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Add tests for Bitmapset  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: [PATCH] Add tests for Bitmapset
Re: [PATCH] Add tests for Bitmapset
List pgsql-hackers
On Thu, Oct 09, 2025 at 04:35:55PM +1300, David Rowley wrote:
> On Thu, 9 Oct 2025 at 15:13, Michael Paquier <michael@paquier.xyz> wrote:
> > What do you think about the attached?
>
> Thanks. Looks pretty good.
>
> > + members = palloc(sizeof(int) * num_ops);
>
> Any reason to pfree that and allocate that to the same size as it already was?

No reason.  We can shortcut that a bit.

> Wondering if the "members[pos] = members[--num_members];" is worth a
> short comment. Maybe something like: /* zap this member by moving the
> final array member into its place and shrinking the array by 1 */

Yes, a comment can be adapted here.  Sounds good to me.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Enhance Makefiles to rebuild objects on map file changes
Next
From: jian he
Date:
Subject: Re: sql/json query function JsonBehavior default expression's collation may differ from returning type's collation