Re: Convert varatt.h macros to static inline functions
От | Greg Burd |
---|---|
Тема | Re: Convert varatt.h macros to static inline functions |
Дата | |
Msg-id | ea72cade-9d66-46b7-a9f4-6b3cb2686eff@burd.me обсуждение исходный текст |
Ответ на | Re: Convert varatt.h macros to static inline functions (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
> On Jul 31, 2025, at 10:06 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Peter Eisentraut <peter@eisentraut.org> writes: >> I had this lying around as a draft patch, as part of my ongoing campaign >> to convert many complicated macros to static inline functions. Since >> the topic was mentioned in another thread [0], I cleaned up the patch so >> that we can all look at it. > > I had just finished doing exactly that, per my idea in the other > thread of providing both pointer and Datum variants where needed. > I'll look more closely at yours in a bit, but here's mine. > > regards, tom lane Thank you both for diving into this, I really appreciate the clarity this brings to the code. I've applied both patches and compared the two approaches. I build and tested Peter's patches on macOS (15.5, M3 Pro) using meson and found no issues. It's clear you both had the same idea in mind, but with slight differences in application. I find VARDATA(DatumGetPointer(key_datums[I])) to be more clear than VARDATA_D(key_datums[I]). Yes, the line length suffers a bit but I find it much more readable. I'm +1 for changes like this, and this one in particular. Just my $0.02, best. -greg
В списке pgsql-hackers по дате отправления: