MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / listDelNode

Function listDelNode

src/adlist.c:168–181  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

166 *
167 * This function can't fail. */
168void 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.

Callers 15

scanGenericCommandFunction · 0.85
scanFilterAndReplyFunction · 0.85
pubsubUnsubscribeChannelFunction · 0.85
pubsubUnsubscribePatternFunction · 0.85
unwatchAllKeysFunction · 0.85
freeClientFunction · 0.85
bioProcessBackgroundJobsFunction · 0.85
freeClientFunction · 0.85

Calls 2

zfreeFunction · 0.85
freeMethod · 0.45

Tested by

no test coverage detected