phrase search TS_phrase_execute code readability patch

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: phrase search TS_phrase_execute code readability patch
Date: 2016-08-09 19:35:06
Message-ID: CAKFQuwbZ2U2i4hMW=tOtODFBo6zjF_2xvGCs+y7NzFrF3f2Eaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
tsvector.diff text/plain 2.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-08-09 20:08:50 Re: Slowness of extended protocol
Previous Message Shay Rojansky 2016-08-09 19:18:40 Re: Slowness of extended protocol