Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-09-28T02:47:22Z
Lists: pgsql-hackers
Thanks for 9d299a492. On Mon, 28 Sep 2020 at 15:35, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > 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? I wouldn't object to the removal of list_third_cell() and list_fourth_cell(). I agree to your reasoning with last_tail(). It does seem more likely that someone would use it. Although, if you'd proposed to remove it too, I wouldn't have objected. It's not like it's hard to reimplement within an extension for any extensions that use it. Though, perhaps it would maybe be a shame if that was the sole thing we broke for them when they try compiling their extension in a year's time on the newly release PG14. David
Commits
-
Add for_each_from, to simplify loops starting from non-first list cells.
- 56fe008996bc 14.0 landed
- 67b2ceea0157 13.1 landed
-
Minor mop-up for List improvements.
- 9d299a492454 14.0 landed
-
Improve pg_list.h's linitial(), lsecond() and co macros
- cc99baa43e0e 14.0 landed