Cosmetic improvements for default text search parser's ts_headline code.
authorTom Lane <[email protected]>
Thu, 9 Apr 2020 16:37:00 +0000 (12:37 -0400)
committerTom Lane <[email protected]>
Thu, 9 Apr 2020 16:37:00 +0000 (12:37 -0400)
commitafab3998685f61d07c3ae05bf22fc5f2a0e92557
tree3a59f487f28d4849d7f656cd9277d68d12621768
parent830471e0dcf67b12f229bfa9489643eb108f580f
Cosmetic improvements for default text search parser's ts_headline code.

This code was woefully unreadable and under-commented.  Try to improve
matters by adding comments, using some macros to make complicated
if-tests more readable, using boolean type where appropriate, etc.
There are a couple of tiny coding improvements too, but this commit
includes (I hope) no behavioral change.

Nonetheless, back-patch as far as 9.6, because a followup bug-fixing
commit depends on this.

Discussion: https://postgr.es/m/16345-2e0cf5cddbdcd3b4@postgresql.org
src/backend/tsearch/wparser_def.c