minishell
minishell copied to clipboard
[LIB] Add new linked list functions to libft
- ~~
ft_lstadd_back_eff()~~ft_lstadd_back_tail() - ~~
ft_lstnew_back_eff()~~ft_lstnew_back_tail() ft_lstdup()ft_lstsize_d()
The efficient versions of ft_lstadd_back expect a tail pointer of the list to avoid traversing the whole list.
I made those function in an older, unmerged branch in February already.
I think *_eff is really confused, why not just replace the logic?
Because it requires a tail pointer as a third argument.
The caller has to provide that, which would require to add that parameter to all calls of ft_lstadd_back() and ft_lstnew_back().
I see the interface change, but i will suggest you to use efficient but not the brief
I renamed the functions:
ft_lstadd_back_eff()->ft_lstadd_back_tail()ft_lstnew_back_eff()->ft_lstnew_back_tail()