Tidy recent code bloat in pg_creatersubscriber::cleanup_objects_atexit
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-11T01:29:42Z
Lists: pgsql-hackers
Attachments
- v1-0001-Add-cleanup_objects_atexit-local-var.patch (application/octet-stream) patch v1-0001
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. Please see the attached patch that implements this suggestion. ====== Kind Regards, Peter Smith Fujitsu Australia
Commits
-
pg_createsubscriber: Remove some code bloat in the atexit() callback
- 83e5763d4ddd 18.0 landed
-
Add two-phase option in pg_createsubscriber.
- e117cfb2f6c6 18.0 cited