pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove jsonapi.c's lex_accept().
Date: Fri, 24 Jan 2020 18:35:28 +0000
Message-ID: <E1iv3nk-0002IT-2H@gemulon.postgresql.org> (raw)

Remove jsonapi.c's lex_accept().

At first glance, this function seems useful, but it actually increases
the amount of code required rather than decreasing it. Inline the
logic into the callers instead; most callers don't use the 'lexeme'
argument for anything and as a result considerable simplification is
possible.

Along the way, fix the header comment for the nearby function
lex_expect(), which mislabeled it as lex_accept().

Patch by me, reviewed by David Steele, Mark Dilger, and Andrew
Dunstan.

Discussion: http://postgr.es/m/CA+TgmoYfOXhd27MUDGioVh6QtpD0C1K-f6ObSA10AWiHBAL5bA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/530609aa4263bee5b5ca205d83f0dbad098d0465

Modified Files
--------------
src/backend/utils/adt/jsonapi.c | 124 +++++++++++++++++-----------------------
1 file changed, 51 insertions(+), 73 deletions(-)



Message-ID: <E1iv3nk-0002IT-2H@gemulon.postgresql.org>
Permalink:  ../E1iv3nk-0002IT-2H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iv3nk-0002IT-2H@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: rhaas@postgresql.org
  Subject: Re: pgsql: Remove jsonapi.c's lex_accept().
  In-Reply-To: <E1iv3nk-0002IT-2H@gemulon.postgresql.org>
  References: <E1iv3nk-0002IT-2H@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