Re: Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit
Date: 2025-03-11 07:06:14
Message-ID: Z8_g5uFsBEIZUB85@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2025-03-11 07:20:04 Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Previous Message jian he 2025-03-11 07:00:53 Re: bogus error message for ALTER TABLE ALTER CONSTRAINT