Skip to content

Commit 7cbda04

Browse files
committed
style: Rename *_eff functions to *_tail
1 parent e04546e commit 7cbda04

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

libraries/libft/build/libft.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ #
77
# +#+#+#+#+#+ +#+ #
88
# Created: 2023/11/16 13:33:38 by ldulling #+# #+# #
9-
# Updated: 2024/06/28 19:31:23 by ldulling ### ########.fr #
9+
# Updated: 2025/05/28 19:26:09 by ldulling ### ########.fr #
1010
# #
1111
# **************************************************************************** #
1212

@@ -86,7 +86,7 @@ SRC += $(addprefix $(DIR), \
8686
DIR := lists/singly_linked/
8787
SRC += $(addprefix $(DIR), \
8888
ft_lstadd_back.c \
89-
ft_lstadd_back_eff.c \
89+
ft_lstadd_back_tail.c \
9090
ft_lstadd_front.c \
9191
ft_lstclear.c \
9292
ft_lstdelone.c \
@@ -99,7 +99,7 @@ SRC += $(addprefix $(DIR), \
9999
ft_lstmap.c \
100100
ft_lstnew.c \
101101
ft_lstnew_back.c \
102-
ft_lstnew_back_eff.c \
102+
ft_lstnew_back_tail.c \
103103
ft_lstnew_front.c \
104104
ft_lstpop_front.c \
105105
ft_lstpop_front_content.c \

libraries/libft/inc/libft.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/09/24 16:17:46 by ldulling #+# #+# */
9-
/* Updated: 2024/06/28 19:31:02 by ldulling ### ########.fr */
9+
/* Updated: 2025/05/28 19:26:17 by ldulling ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -66,7 +66,7 @@ int ft_lstsize_d(t_list_d *lst);
6666
/* Lists singly-linked */
6767

6868
void ft_lstadd_back(t_list **lst, t_list *new);
69-
void ft_lstadd_back_eff(t_list **lst, t_list **tail, t_list *new);
69+
void ft_lstadd_back_tail(t_list **lst, t_list **tail, t_list *new);
7070
void ft_lstadd_front(t_list **lst, t_list *new);
7171
void ft_lstclear(t_list **lst, void (*del)(void *));
7272
void ft_lstdelone(t_list *lst, void (*del)(void *));
@@ -79,7 +79,7 @@ t_list *ft_lstlast(t_list *lst);
7979
t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *));
8080
t_list *ft_lstnew(void *content);
8181
bool ft_lstnew_back(t_list **lst, void *content);
82-
bool ft_lstnew_back_eff(t_list **lst, t_list **tail, void *content);
82+
bool ft_lstnew_back_tail(t_list **lst, t_list **tail, void *content);
8383
bool ft_lstnew_front(t_list **lst, void *content);
8484
t_list *ft_lstpop_front(t_list **lst);
8585
void *ft_lstpop_front_content(t_list **lst);

libraries/libft/src/lists/singly_linked/ft_lstadd_back_eff.c renamed to libraries/libft/src/lists/singly_linked/ft_lstadd_back_tail.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/* ************************************************************************** */
22
/* */
33
/* ::: :::::::: */
4-
/* ft_lstadd_back_eff.c :+: :+: :+: */
4+
/* ft_lstadd_back_tail.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
66
/* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2024/02/11 00:35:15 by ldulling #+# #+# */
9-
/* Updated: 2024/06/07 19:10:00 by ldulling ### ########.fr */
9+
/* Updated: 2025/05/28 19:29:42 by ldulling ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
/**
16-
* The ft_lstadd_back_eff function adds a node to the end of the singly linked
16+
* The ft_lstadd_back_tail function adds a node to the end of the singly linked
1717
* list.
1818
* It uses the tail pointer of the list to avoid traversing the whole list.
1919
* The tail pointer is updated to point to the new node.
@@ -22,10 +22,10 @@
2222
* @param tail The address of the pointer to the last node of the list.
2323
* @param new The new node to be added to the list.
2424
*
25-
* @return This function does not return a value.
25+
* @return No return value.
2626
*
2727
*/
28-
void ft_lstadd_back_eff(t_list **lst, t_list **tail, t_list *new)
28+
void ft_lstadd_back_tail(t_list **lst, t_list **tail, t_list *new)
2929
{
3030
if (*lst == NULL)
3131
*lst = new;

libraries/libft/src/lists/singly_linked/ft_lstdup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2024/02/11 00:35:12 by ldulling #+# #+# */
9-
/* Updated: 2024/06/07 19:09:20 by ldulling ### ########.fr */
9+
/* Updated: 2025/05/28 19:27:00 by ldulling ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -44,7 +44,7 @@ t_list *ft_lstdup(t_list *lst, void *(*dup)(void *), void (*del)(void *))
4444
new_content = (*dup)(cur->content);
4545
if (new_content == NULL)
4646
return (ft_lstclear(&new_lst, del), NULL);
47-
if (!ft_lstnew_back_eff(&new_lst, &new_lst_tail, new_content))
47+
if (!ft_lstnew_back_tail(&new_lst, &new_lst_tail, new_content))
4848
return (del(new_content), ft_lstclear(&new_lst, del), NULL);
4949
cur = cur->next;
5050
}

libraries/libft/src/lists/singly_linked/ft_lstmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/09/24 16:04:35 by ldulling #+# #+# */
9-
/* Updated: 2024/02/11 00:40:18 by ldulling ### ########.fr */
9+
/* Updated: 2025/05/28 19:27:05 by ldulling ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -35,7 +35,7 @@ t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *))
3535
ft_lstclear(&new_lst, del);
3636
return (NULL);
3737
}
38-
ft_lstadd_back_eff(&new_lst, &new_lst_tail, new_node);
38+
ft_lstadd_back_tail(&new_lst, &new_lst_tail, new_node);
3939
cur = cur->next;
4040
}
4141
return (new_lst);
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/* ************************************************************************** */
22
/* */
33
/* ::: :::::::: */
4-
/* ft_lstnew_back_eff.c :+: :+: :+: */
4+
/* ft_lstnew_back_tail.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
66
/* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2024/06/07 19:11:17 by ldulling #+# #+# */
9-
/* Updated: 2024/06/07 19:11:21 by ldulling ### ########.fr */
9+
/* Updated: 2025/05/28 19:26:46 by ldulling ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

1313
#include "libft.h"
1414

1515
/**
16-
* The ft_lstnew_back_eff function creates a new node with the provided content
16+
* The ft_lstnew_back_tail function creates a new node with the provided content
1717
* and adds it to the end of the singly linked list.
1818
* It uses the tail pointer of the list to avoid traversing the whole list.
1919
* The tail pointer is updated to point to the new node.
@@ -26,13 +26,13 @@
2626
* if malloc failed.
2727
*
2828
*/
29-
bool ft_lstnew_back_eff(t_list **lst, t_list **tail, void *content)
29+
bool ft_lstnew_back_tail(t_list **lst, t_list **tail, void *content)
3030
{
3131
t_list *new_node;
3232

3333
new_node = ft_lstnew(content);
3434
if (new_node == NULL)
3535
return (false);
36-
ft_lstadd_back_eff(lst, tail, new_node);
36+
ft_lstadd_back_tail(lst, tail, new_node);
3737
return (true);
3838
}

0 commit comments

Comments
 (0)