Re: Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit
Date
Msg-id Z8_g5uFsBEIZUB85@paquier.xyz
Whole thread Raw
In response to Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit
List pgsql-hackers
On Tue, Mar 11, 2025 at 12:29:42PM +1100, Peter Smith wrote:
> During a recent review of pg_creatersubscriber I saw that commit
> e117cfb introduced a common 'dbinfos' struct to contain the array of
> individual 'dbinfo[i]' infos. But, this now means that getting to each
> dbinfo[i] requires another level of referencing.
>
> In some places, e.g. function cleanup_objects_atexit, this caused
> unnecessary code bloat. IMO this function is crying out for a local
> variable to simplify the code again.

Right.  This improves the clarity of the code, so agreed about the use
of a local variable here.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
Next
From: Peter Smith
Date:
Subject: Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.