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

Function dictAddOrFind

src/dict.cpp:696–700  ·  view source on GitHub ↗

Add or Find: * dictAddOrFind() is simply a version of dictAddRaw() that always * returns the hash entry of the specified key, even if the key already * exists and can't be added (in that case the entry of the already * existing key is returned.) * * See dictAddRaw() for more information. */

Source from the content-addressed store, hash-verified

694 *
695 * See dictAddRaw() for more information. */
696dictEntry *dictAddOrFind(dict *d, void *key) {
697 dictEntry *entry, *existing;
698 entry = dictAddRaw(d,key,&existing);
699 return entry ? entry : existing;
700}
701
702/* Search and remove an element. This is an helper function for
703 * dictDelete() and dictUnlink(), please check the top comment

Callers 1

Calls 1

dictAddRawFunction · 0.85

Tested by

no test coverage detected