pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Minor code refactoring in elog.c (no functional change).
Date: Wed, 07 Dec 2022 19:39:45 +0000
Message-ID: <E1p30Ge-002PXh-Uw@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1p30Ge-002PXh-Uw@gemulon.postgresql.org>
Permalink:  ../E1p30Ge-002PXh-Uw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p30Ge-002PXh-Uw@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Minor code refactoring in elog.c (no functional change).
  In-Reply-To: <E1p30Ge-002PXh-Uw@gemulon.postgresql.org>
  References: <E1p30Ge-002PXh-Uw@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox