Remove the specified node from the specified list. * It's up to the caller to free the private value of the node. * * This function can't fail. */
| 166 | * |
| 167 | * This function can't fail. */ |
| 168 | void listDelNode(list *list, listNode *node) |
| 169 | { |
| 170 | if (node->prev) |
| 171 | node->prev->next = node->next; |
| 172 | else |
| 173 | list->head = node->next; |
| 174 | if (node->next) |
| 175 | node->next->prev = node->prev; |
| 176 | else |
| 177 | list->tail = node->prev; |
| 178 | if (list->free) list->free(node->value); |
| 179 | zfree(node); |
| 180 | list->len--; |
| 181 | } |
| 182 | |
| 183 | /* Returns a list iterator 'iter'. After the initialization every |
| 184 | * call to listNext() will return the next element of the list. |
no test coverage detected