From: Lukáš Jiřiště Date: Thu, 31 Jul 2025 13:09:59 +0000 (+0200) Subject: Remove the parent member from t_tree X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=60ea2228a20f4891ad70e82bf3c3ec06624e4050;p=Libft.git Remove the parent member from t_tree I see little use for this now. It is trivial to add it later. --- diff --git a/ft_struct/ft_tree_append_child.c b/ft_struct/ft_tree_append_child.c index 2a5d9ef..6477abf 100644 --- a/ft_struct/ft_tree_append_child.c +++ b/ft_struct/ft_tree_append_child.c @@ -12,7 +12,6 @@ t_ft_stat ft_tree_append_child(t_tree_node *tree_node, void *element) if (res != success) return (res); new_node = ft_tree_access_child(tree_node, tree_node->children.size - 1); - new_node->parent = tree_node; res = ft_vec_init(&new_node->children, tree_node->children.el_size); if (res != success) { diff --git a/ft_struct/ft_tree_init.c b/ft_struct/ft_tree_init.c index b83fae8..247d2cf 100644 --- a/ft_struct/ft_tree_init.c +++ b/ft_struct/ft_tree_init.c @@ -12,7 +12,6 @@ t_ft_stat ft_tree_init(t_tree *tree, void *root_element, size_t el_size) if (!root) return (alloc_fail); *tree = root; - root->parent = NULL; ft_memcpy(&root->data, root_element, el_size); return (ft_vec_init(&root->children, sizeof(t_tree_node) + el_size)); } diff --git a/inc/ft_struct.h b/inc/ft_struct.h index bcebe0b..8d4f4c1 100644 --- a/inc/ft_struct.h +++ b/inc/ft_struct.h @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/20 16:59:43 by ljiriste #+# #+# */ -/* Updated: 2025/07/31 14:07:12 by ljiriste ### ########.fr */ +/* Updated: 2025/07/31 15:07:44 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -42,7 +42,6 @@ typedef struct s_tree_node t_tree_node; struct s_tree_node { - t_tree_node *parent; t_vec children; char data[]; };