Simplify json lexing state
authorJohn Naylor <john.naylor@postgresql.org>
Fri, 8 Jul 2022 07:53:20 +0000 (14:53 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Fri, 8 Jul 2022 07:53:20 +0000 (14:53 +0700)
commit3de359f18f2bfbc96272bd265264aa5c2f247ca4
treeee52d8d365354e0371c52a15e0542bddeca4a0fd
parent3140f089855c03035ee354aa115618068f8d0206
Simplify json lexing state

Instead of updating the length as we go, use a const pointer to end of
the input, which we know already at the start.

This simplifies the coding and may improve performance slightly, but
the real motivation for doing this is to make further changes in this
area easier to reason about.

Discussion: https://www.postgresql.org/message-id/CAFBsxsGhaR2KQ5eisaK%3D6Vm60t%3DaxhD8Ckj1qFoCH1pktZi%2B2w%40mail.gmail.com
src/common/jsonapi.c