Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros
Date: 2020-09-27 23:58:55
Message-ID: 171412.1601251135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-09-28 00:21:51 Re: "cert" + clientcert=verify-ca in pg_hba.conf?
Previous Message Greg Nancarrow 2020-09-27 23:41:41 Re: Parallel INSERT (INTO ... SELECT ...)