Re: useless list_tail()?

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
Subject: Re: useless list_tail()?
Date: 2025-01-15 13:47:22
Message-ID: CAJ7c6TPGGL0Ga2rFmLmJR2tPmAraJTP2WomnuxXuWmQ4vx-Ntg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> While working with lists, I've been utilizing the llast() macro to retrieve the last element.
> During this process, I noticed that the list_tail() function is not being used anywhere in the codebase.
> Its last usage was removed in commit a8d8445a7b in favor of llast().

I'm not entirely sure. Although being a static inline function,
list_tail() is declared in a .h file. Removing it may break 3rd party
code.

Note that list_tail() and llast() don't do exactly the same.
list_tail() accepts NIL lists while llast() works only for non-NIL
lists.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mingli Zhang 2025-01-15 13:52:36 Re: useless list_tail()?
Previous Message Zhang Mingli 2025-01-15 13:35:48 useless list_tail()?