Rework redundant code in subtrans.c
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 5 Mar 2024 11:09:18 +0000 (12:09 +0100)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 5 Mar 2024 11:09:18 +0000 (12:09 +0100)
commit1a2654b32b546d25e39a0c02410049559a3d4573
tree00e7e463d7113fe872912f271d04671c3eb085b6
parent030e10ff1a365796bd4bcbbc5b6a8552f7efc765
Rework redundant code in subtrans.c

When this code was written the duplicity didn't matter, but with all the
SLRU-bank stuff we just added, it has become excessive.  Turn it into a
simpler loop with no code duplication.  Also add a test so that this
code becomes covered.

Discussion: https://postgr.es/m/202403041517.3a35jw53os65@alvherre.pgsql
src/backend/access/transam/subtrans.c
src/test/recovery/t/009_twophase.pl