diff options
Diffstat (limited to 'c12/ex07')
| -rw-r--r-- | c12/ex07/ft_list_at.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/c12/ex07/ft_list_at.c b/c12/ex07/ft_list_at.c index 5176a76..ad4b084 100644 --- a/c12/ex07/ft_list_at.c +++ b/c12/ex07/ft_list_at.c @@ -6,7 +6,7 @@ /* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/09 17:56:31 by cacharle #+# #+# */ -/* Updated: 2019/07/09 18:01:18 by cacharle ### ########.fr */ +/* Updated: 2019/07/17 18:36:07 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,13 +14,7 @@ t_list *ft_list_at(t_list *begin_list, unsigned int nbr) { - int i; - - i = 0; - while (i < nbr && begin_list) - { + while (nbr-- > 0 && begin_list) begin_list = begin_list->next; - i++; - } return (begin_list); } |
