Skip to content

Commit

Permalink
removing unnecessary steps
Browse files Browse the repository at this point in the history
  • Loading branch information
biralavor committed Jul 3, 2024
1 parent 534e50e commit 196b50a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions program_to_test/src/ft_lst_deletes.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: umeneses <umeneses@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/13 14:49:58 by umeneses #+# #+# */
/* Updated: 2024/06/06 14:50:52 by umeneses ### ########.fr */
/* Updated: 2024/07/02 21:00:44 by umeneses ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -16,13 +16,6 @@ t_stack *ft_lst_delat_begin(t_stack *stack)
{
t_stack *temp;

if (!stack || !stack->next)
{
temp = stack;
stack = NULL;
free(stack);
return (stack);
}
stack = ft_lst_goto_head(stack);
stack->next->prev = NULL;
temp = stack->next;
Expand All @@ -35,11 +28,6 @@ t_stack *ft_lst_delat_end(t_stack *stack)
t_stack *second_last_node;

second_last_node = NULL;
if (!stack || !stack->next)
{
free(stack);
return (NULL);
}
second_last_node = ft_lst_goto_before_end(stack);
free(second_last_node->next);
second_last_node->next = NULL;
Expand Down

0 comments on commit 196b50a

Please sign in to comment.