Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros
Date
Msg-id 171412.1601251135@sss.pgh.pa.us
Whole thread Raw
In response to Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I'm a bit unsure about llast()'s new double evaluation of the list.
> Perhaps I can add a new inline function named list_last_cell() to get
> around that... Or maybe it doesn't matter. I'm not quite sure what's
> best there.

Double evaluation bad, especially in a macro that has not had such a
hazard for the last twenty-plus years.

It might not be worth mucking with llast, as it's not used very heavily
I believe.  But if it is, then let's add another inline function.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: Parallel INSERT (INTO ... SELECT ...)
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: "cert" + clientcert=verify-ca in pg_hba.conf?