| 79 | } |
| 80 | |
| 81 | void ClearList(List* list, ListItemFn fn) { |
| 82 | ListItem* walk = list->head; |
| 83 | |
| 84 | while (walk) { |
| 85 | ListItem* save = walk; |
| 86 | walk = walk->next; |
| 87 | if (fn) { |
| 88 | fn(save, NULL); |
| 89 | } |
| 90 | delete save; |
| 91 | } |
| 92 | |
| 93 | list->head = NULL; |
| 94 | list->tail = NULL; |
| 95 | list->size = 0; |
| 96 | } |
| 97 | |
| 98 | ListItem* FindFromListHead(List* list, ListItemCmpFn cmp, const void* sample) { |
| 99 | ListItem* walk = list->head; |
no outgoing calls
no test coverage detected