phrase search TS_phrase_execute code readability patch - Mailing list pgsql-hackers

From David G. Johnston
Subject phrase search TS_phrase_execute code readability patch
Date
Msg-id CAKFQuwbZ2U2i4hMW=tOtODFBo6zjF_2xvGCs+y7NzFrF3f2Eaw@mail.gmail.com
Whole thread Raw
Responses Re: phrase search TS_phrase_execute code readability patch  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hackers,

The attached attempts to make comprehension of the code in "TS_phrase_execute" a bit easier.  I posted similar on the "typo patch" thread of July 2nd/5th but my comments there reflected my mis-understanding of the distance operator being exact as opposed to the expected less-than-or-equal.

I had to make one assumption for the attached - that "curitem->qoperator.distance" is always >= 0.  In the presence of that assumption the need for the OR goes away.

I don't follow why LposStart is needed so I removed it...

Not compiled or in any way tested...but its not major surgery either - mostly code comments to make following the logic easier.

David J.





Attachment

pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: Re: Slowness of extended protocol
Next
From: Robert Haas
Date:
Subject: Re: Slowness of extended protocol