useless list_tail()?

Started by Zhang Mingli12 months ago3 messages
#1Zhang Mingli
zmlpostgres@gmail.com

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().

Shall we remove it?

Zhang Mingli
www.hashdata.xyz

#2Aleksander Alekseev
aleksander@timescale.com
In reply to: Zhang Mingli (#1)
Re: useless list_tail()?

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

#3Mingli Zhang
zmlpostgres@gmail.com
In reply to: Aleksander Alekseev (#2)
Re: useless list_tail()?

Aleksander Alekseev <aleksander@timescale.com>于2025年1月15日 周三21:47写道:

list_tail() is declared in a .h file. Removing it may break 3rd party
code.

Make sense, other extensions may already be using it.

Show quoted text