On Sat, Dec 21, 2024 at 12:16 AM Andrey M. Borodin <x4...@yandex-team.ru> wrote: > > > > > On 16 Dec 2024, at 14:02, John Naylor <johncnaylo...@gmail.com> wrote: > > > > Sorry, I forgot this part earlier. Yes, let's have the private function. > > PFA v6.
v6-0001: +static int +unique_cmp(const void *a, const void *b) +{ + int32 aval = *((const int32 *) a); + int32 bval = *((const int32 *) b); + + return pg_cmp_s32(aval, bval); +} I'm not sure it makes sense to create a whole new function for this, when the same patch removed: -int -compASC(const void *a, const void *b) -{ - return pg_cmp_s32(*(const int32 *) a, *(const int32 *) b); -} ...which in effect the exact same thing. Otherwise seems close to committable. v6-0002: Seems like a good idea to be more consistent, but I admit I'm not much a fan of little indirection macros like this. It makes the code less readable in my view. v6-0003: I didn't feel like digging further. It's interesting that inner_int_inter() takes care to detect the zero-length case and free the old array to avoid resizing. -- John Naylor Amazon Web Services