pgsql: Minor code refactoring in elog.c (no functional change).

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Minor code refactoring in elog.c (no functional change).
Date: 2022-12-07 19:39:45
Message-ID: E1p30Ge-002PXh-Uw@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Minor code refactoring in elog.c (no functional change).

Combine some duplicated code stanzas by creating small functions.
Most of these duplications arose at a time when I wouldn't have
trusted C compilers to auto-inline small functions intelligently,
but they're probably poor practice now. Similarly split out some
bits that aren't actually duplicative as the code stands, but would
become so after an upcoming patch to add another error-handling
code path.

Take the opportunity to add some lengthier comments about what
we're doing here, too. Re-order one function that seemed not
very well-placed.

Patch by me, per suggestions from Andres Freund.

Discussion: https://postgr.es/m/3bbbb0df-7382-bf87-9737-340ba096e034@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8305629afe64c9065369d022e91be9f16f3972fa

Modified Files
--------------
src/backend/utils/error/elog.c | 257 ++++++++++++++++++++++-------------------
1 file changed, 141 insertions(+), 116 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-12-07 20:48:29 pgsql: meson: Add 'running' test setup, as a replacement for installche
Previous Message Tom Lane 2022-12-07 18:56:55 pgsql: Doc: subdivide System Information Functions and Operators.