pgsql: Remove jsonapi.c's lex_accept(). - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Remove jsonapi.c's lex_accept().
Date
Msg-id E1iv3nk-0002IT-2H@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Split JSON lexer/parser from 'json' data type support.
Next
From: Dean Rasheed
Date:
Subject: pgsql: Add functions gcd() and lcm() for integer and numeric types.