Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** delete_list | ||
4 | ** File description: | ||
5 | ** Deletes a linked list | ||
6 | */ | ||
7 | /** | ||
8 | * @file my_delete_list.c | ||
9 | * @brief The file containing the my_delete_list function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "mylist.h" | ||
14 | |||
15 | 10346 | void my_delete_list(node_t **begin) | |
16 | { | ||
17 | 10346 | node_t *tmp = *begin; | |
18 | 10346 | node_t *next = NULL; | |
19 | |||
20 |
2/2✓ Branch 0 taken 58169 times.
✓ Branch 1 taken 10346 times.
|
68515 | while (tmp != NULL) { |
21 | 58169 | next = tmp->next; | |
22 |
4/6✓ Branch 0 taken 58169 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 58169 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 41087 times.
✓ Branch 5 taken 17082 times.
|
58169 | if (tmp->data && tmp->data != NULL && tmp->type != UNKNOWN) |
23 | 41087 | FREE(tmp->data); | |
24 |
1/2✓ Branch 0 taken 58169 times.
✗ Branch 1 not taken.
|
58169 | if (tmp) |
25 | 58169 | FREE(tmp); | |
26 | 58169 | tmp = next; | |
27 | } | ||
28 | 10346 | *begin = NULL; | |
29 | 10346 | } | |
30 |