MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dictAddOrFind

Function dictAddOrFind

app/redis-6.2.6/src/dict.c:382–386  ·  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

380 *
381 * See dictAddRaw() for more information. */
382dictEntry *dictAddOrFind(dict *d, void *key) {
383 dictEntry *entry, *existing;
384 entry = dictAddRaw(d,key,&existing);
385 return entry ? entry : existing;
386}
387
388/* Search and remove an element. This is an helper function for
389 * dictDelete() and dictUnlink(), please check the top comment

Callers 2

setExpireFunction · 0.85

Calls 1

dictAddRawFunction · 0.85

Tested by

no test coverage detected