Cosmetic improvements for default text search parser's ts_headline code.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 1306edeae3b362b57b37b41e7b6a14406d03ebad
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-04-09T16:36:59Z
Releases: 12.3
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

Files

PathChange+/−
src/backend/tsearch/wparser_def.c modified +176 −97

Discussion