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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-09-28T02:35:06Z
Lists: pgsql-hackers
Poking around to count remaining uses of those inline functions,
I found a few places that should be using the macros instead,
and fixed them.  After that, I notice that list_tail(),
list_third_cell(), and list_fourth_cell() are entirely unreferenced.
I'm hesitant to get rid of list_tail(), because it seems like it
could well be used by extensions.  But I'd bet quite a bit that
list_third_cell() and list_fourth_cell() are not used anywhere
anymore.  Should we get rid of them to shave a few microseconds
from compile times?

			regards, tom lane



Commits

  1. Add for_each_from, to simplify loops starting from non-first list cells.

  2. Minor mop-up for List improvements.

  3. Improve pg_list.h's linitial(), lsecond() and co macros