Re: [PATCH] Little refactoring of portalcmds.c - Mailing list pgsql-hackers

From wenhui qiu
Subject Re: [PATCH] Little refactoring of portalcmds.c
Date
Msg-id CAGjGUAJJCO0cYA297226epqwfj+UutGnYUigng9riApJo+pm=Q@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Little refactoring of portalcmds.c  (Quan Zongliang <quanzongliang@yeah.net>)
List pgsql-hackers
Hi Aleksander Alekseev
> The proposed patch places some repetitive code in a helper function.
> The value of this change is arguably not that high but it makes the
> code a bit neater IMO. 
I  agree with your suggestion to refactor the duplicated code into a function.

Thanks 

On Mon, Oct 27, 2025 at 2:03 PM Quan Zongliang <quanzongliang@yeah.net> wrote:


On 10/8/25 10:02 PM, Aleksander Alekseev wrote:
> Hi,
>
> The proposed patch places some repetitive code in a helper function.
> The value of this change is arguably not that high but it makes the
> code a bit neater IMO.
>

It also reduces the ease of reading the code.
Just add a function for a single if statement. I don't think it's necessary.

Regards,
Quan Zongliang



pgsql-hackers by date:

Previous
From: Japin Li
Date:
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance
Next
From: shveta malik
Date:
Subject: Re: Report bytes and transactions actually sent downtream