Re: Remove unneeded cast in heap_xlog_lock.

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove unneeded cast in heap_xlog_lock.
Date: 2025-08-22 10:25:38
Message-ID: 91D58D7F-B9A9-42F3-96F4-415A04E9097E@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Aug 22, 2025, at 13:36, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
>
> 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
> <v2-0001-Remove-unneeded-cast-in-BufferGetPage.patch>

As there are only 76 occurrences, I think using one commit to clean up the unnecessary cast is worthwhile.

--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-08-22 10:34:33 Potential problem in commit f777d773878 and 4f7f7b03758
Previous Message jian he 2025-08-22 10:17:19 Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt