Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LIB] Add new linked list functions to libft #341

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

itislu
Copy link
Collaborator

@itislu itislu commented Jun 7, 2024

  • ft_lstadd_back_eff()
  • ft_lstnew_back_eff()
  • 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.

@itislu itislu added the feature New feature of the project label Jun 7, 2024
@LeaYeh
Copy link
Owner

LeaYeh commented Jun 8, 2024

I think *_eff is really confused, why not just replace the logic?

@itislu
Copy link
Collaborator Author

itislu commented Jun 8, 2024

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

@LeaYeh
Copy link
Owner

LeaYeh commented Jun 8, 2024

I see the interface change, but i will suggest you to use efficient but not the brief

@itislu itislu changed the title [LIB] Add ft_lstadd_back_eff(), ft_lstnew_back_eff() and ft_lstdup() to libft [LIB] Add new linked list functions to libft Jul 2, 2024
@itislu itislu force-pushed the lib-lstdup branch 3 times, most recently from 93bb7ce to 42c4c87 Compare July 5, 2024 14:21
LeaYeh
LeaYeh previously approved these changes Jul 9, 2024
@itislu itislu force-pushed the lib-lstdup branch 4 times, most recently from b16a8ab to af2ea28 Compare July 12, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature of the project
Projects
Status: Ready
Development

Successfully merging this pull request may close these issues.

2 participants