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

Function dictFind

app/redis-6.2.6/src/dict.c:503–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501}
502
503dictEntry *dictFind(dict *d, const void *key)
504{
505 dictEntry *he;
506 uint64_t h, idx, table;
507
508 if (dictSize(d) == 0) return NULL; /* dict is empty */
509 if (dictIsRehashing(d)) _dictRehashStep(d);
510 h = dictHashKey(d, key);
511 for (table = 0; table <= 1; table++) {
512 idx = h & d->ht[table].sizemask;
513 he = d->ht[table].table[idx];
514 while(he) {
515 if (key==he->key || dictCompareKeys(d, key, he->key))
516 return he;
517 he = he->next;
518 }
519 if (!dictIsRehashing(d)) return NULL;
520 }
521 return NULL;
522}
523
524void *dictFetchValue(dict *d, const void *key) {
525 dictEntry *he;

Callers 15

dictFetchValueFunction · 0.70
dictTestFunction · 0.70
getKeyTypesFunction · 0.70
luaCreateFunctionFunction · 0.70
scriptCommandFunction · 0.70

Calls 1

_dictRehashStepFunction · 0.85

Tested by

no test coverage detected