Re: Remove unneeded cast in heap_xlog_lock.

Поиск
Список
Период
Сортировка
От Kirill Reshke
Тема Re: Remove unneeded cast in heap_xlog_lock.
Дата
Msg-id CALdSSPjVW0K5vbaUGNWu=yab3AXz=n-Wzx0LjfF_wRz2YN1aew@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Remove unneeded cast in heap_xlog_lock.  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Remove unneeded cast in heap_xlog_lock.
Re: Remove unneeded cast in heap_xlog_lock.
Список pgsql-hackers
On Fri, 22 Aug 2025 at 06:41, Richard Guo <guofenglinux@gmail.com> wrote:
>
> If you run 'git grep', you'll find a lot more instances where the
> result of BufferGetPage() is explicitly cast to Page.
>
> git grep -rn "(Page) BufferGetPage" | wc -l
> 69
>
> Although these casts are unnecessary for sure, I'm not sure if it's
> worth making the code changes to fix them.

I can see your point. But I can see that there is a great amount of
commits in HEAD (every now and then), which are just pure refactoring
and standardizing things.
I am uncertain about the delineation between when we make changes and
when we refrain from doing so.

I do not insist on this modification. I just spotted two completely
same codes in [0] & [1], which only differ in BufferGetPage cast. And
I merely tried to do something with it.

v2 attached with all 69 casts removed, but I see there is a little
chance of this committed.

[0] https://github.com/postgres/postgres/blob/13b935c/src/backend/access/heap/heapam_xlog.c#L1007-L1050
[1] https://github.com/postgres/postgres/blob/13b935c/src/backend/access/heap/heapam_xlog.c#L1083-L1121

-- 
Best regards,
Kirill Reshke

Вложения

В списке pgsql-hackers по дате отправления: