pgsql: Rework redundant code in subtrans.c

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Rework redundant code in subtrans.c
Date: 2024-03-05 11:11:46
Message-ID: E1rhSi2-002CPS-BY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1a2654b32b546d25e39a0c02410049559a3d4573

Modified Files
--------------
src/backend/access/transam/subtrans.c | 29 ++++++------------------
src/test/recovery/t/009_twophase.pl | 42 +++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 22 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2024-03-05 11:15:48 pgsql: Fix misspelled assertions
Previous Message Peter Eisentraut 2024-03-05 10:28:50 pgsql: Rename pg_constraint.conwithoutoverlaps to conperiod