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

Function dictUnlink

src/dict.cpp:781–783  ·  view source on GitHub ↗

Remove an element from the table, but without actually releasing * the key, value and dictionary entry. The dictionary entry is returned * if the element was found (and unlinked from the table), and the user * should later call `dictFreeUnlinkedEntry()` with it in order to release it. * Otherwise if the key is not found, NULL is returned. * * This function is useful when we want to remove so

Source from the content-addressed store, hash-verified

779 * dictFreeUnlinkedEntry(entry); // <- This does not need to lookup again.
780 */
781dictEntry *dictUnlink(dict *ht, const void *key) {
782 return dictGenericDelete(ht,key,1);
783}
784
785/* You need to call this function to really free the entry after a call
786 * to dictUnlink(). It's safe to call this function with 'he' = NULL. */

Callers 7

syncDeleteMethod · 0.85
removeCachedValueMethod · 0.85
asyncDeleteMethod · 0.85
zsetRemoveFromSkiplistFunction · 0.85

Calls 1

dictGenericDeleteFunction · 0.85

Tested by

no test coverage detected