[PATCH] aio: Refactor to deduplicate shared and local completion callbacks - Mailing list pgsql-hackers

From zengman
Subject [PATCH] aio: Refactor to deduplicate shared and local completion callbacks
Date
Msg-id tencent_1910067D4CAEBF0B56359140@qq.com
Whole thread Raw
Responses Re: [PATCH] aio: Refactor to deduplicate shared and local completion callbacks
List pgsql-hackers
Hi,

I've observed that the functions `pgaio_io_call_complete_shared()` and` pgaio_io_call_complete_local()` contain nearly
identicalcode, 
 
with only minor differences in initialization and callback selection. 
This code duplication was previously noted with an XXX comment.
I propose extracting the common logic into a new internal function `pgaio_io_call_complete_internal()`, 
which uses a boolean parameter to distinguish between the two code paths. 
What do you think of this approach?

--
Regards,
Man Zeng
www.openhalo.org
Attachment

pgsql-hackers by date:

Previous
From: Amul Sul
Date:
Subject: Re: pg_waldump: support decoding of WAL inside tarfile
Next
From: Henson Choi
Date:
Subject: Re: SQL Property Graph Queries (SQL/PGQ)