transforme lstiter sans recursive
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/11/25 14:14:11 by hulamy #+# #+# */
|
||||
/* Updated: 2019/11/25 14:34:59 by hulamy ### ########.fr */
|
||||
/* Updated: 2019/11/28 17:19:34 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -75,9 +75,13 @@
|
||||
|
||||
void ft_lstiter(t_list *lst, void (*f)(void *))
|
||||
{
|
||||
if (!lst)
|
||||
return ;
|
||||
if (lst->next)
|
||||
ft_lstiter(lst->next, f);
|
||||
f(lst);
|
||||
|
||||
if (lst && f)
|
||||
{
|
||||
while (lst)
|
||||
{
|
||||
f(lst);
|
||||
lst = lst->next;
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user