Re: fix for BUG #3720: wrong results at using ltree - Mailing list pgsql-hackers

From Nikita Glukhov
Subject Re: fix for BUG #3720: wrong results at using ltree
Date
Msg-id 9247ddc2-d1e0-7d62-55a6-62a089e99a8a@postgrespro.ru
Whole thread Raw
In response to Re: fix for BUG #3720: wrong results at using ltree  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: fix for BUG #3720: wrong results at using ltree  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 31.03.2020 1:12, Tom Lane wrote:

I wrote:
I dunno, that doesn't really seem clearer to me (although some of it
might be that you expended no effort on making the comments match
the new code logic).
... although looking closer, this formulation does have one very nice
advantage: for the typical non-star case with high = low = 1, the
only recursive call is a tail recursion, so it ought to consume less
stack space than what I wrote.
And we even can simply transform this tail call into a loop:

-if (tlen > 0 && qlen > 0)
+while (tlen > 0 && qlen > 0)

Let me see what I can do with the comments.
Thanks.

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: fix for BUG #3720: wrong results at using ltree
Next
From: Tom Lane
Date:
Subject: Re: fix for BUG #3720: wrong results at using ltree