On Thu, 18 Jan 2024 at 16:24, David Rowley <dgrowle...@gmail.com> wrote: > On Thu, 18 Jan 2024 at 15:22, Richard Guo <guofengli...@gmail.com> wrote: > > Do you think we can use 'memcpy(a, b, BITMAPSET_SIZE(b->nwords))' > > directly in the new bms_replace_members() instead of copying the > > bitmapwords one by one, like: > > > > - i = 0; > > - do > > - { > > - a->words[i] = b->words[i]; > > - } while (++i < b->nwords); > > - > > - a->nwords = b->nwords; > > + memcpy(a, b, BITMAPSET_SIZE(b->nwords)); > > > > But I'm not sure if this is an improvement or not. > > I considered this earlier but felt it was going against the method > used in other places in the file. However, on relooking I do see > bms_copy() does a memcpy().
I feel it's not worth debating the memcpy thing any further, so I've pushed the v2 patch. Thanks for reviewing. David