From: | Richard Guo <guofenglinux(at)gmail(dot)com> |
---|---|
To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(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 01:41:15 |
Message-ID: | CAMbWs4-rZAqry+vmrECn6g7T5R97max67tC1CrAdTO02fx5k1g@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Aug 22, 2025 at 9:44 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> On Aug 21, 2025, at 22:10, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
> I was looking at how PostgreSQL handles VM map bits, when I noticed $subj.
> PFA small refactoring patch.
> LGTM. BufferGetPage() returns a “Page” type, and the receiving variable “page” is of “Page” type as well, so the cast is not needed.
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.
Thanks
Richard
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Munro | 2025-08-22 01:41:44 | Re: VM corruption on standby |
Previous Message | Japin Li | 2025-08-22 01:29:20 | Re: Standardize LSN-based filename |