MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / HashTableFind

Function HashTableFind

src/util/dict.c:586–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586dictEntry *HashTableFind(dict *d, const void *key)
587{
588 dictEntry *he;
589 uint64_t h, idx, table;
590
591 if (dictSize(d) == 0) return NULL; /* dict is empty */
592 if (dictIsRehashing(d)) _dictRehashStep(d);
593 h = dictHashKey(d, key);
594 //printf("HashTableFind hash: %llu\n", h);
595 for (table = 0; table <= 1; table++) {
596 idx = h & DICTHT_SIZE_MASK(d->ht_size_exp[table]);
597 he = d->ht_table[table][idx];
598 while(he) {
599 //printf("key: %llu, he->key: %llu\n", key, he->key);
600 if (key==he->key || dictCompareKeys(d, key, he->key)) {
601 //printf("keys are the same!\n");
602 return he;
603 }
604 he = he->next;
605 }
606 if (!dictIsRehashing(d)) return NULL;
607 }
608 return NULL;
609}
610
611void *HashTableFetchValue(dict *d, const void *key) {
612 dictEntry *he;

Callers 4

AR_INSERTLISTELEMENTSFunction · 0.85
HashTableFetchValueFunction · 0.85
_CloneOpTreeFunction · 0.85
EvalEntityUpdatesFunction · 0.85

Calls 1

_dictRehashStepFunction · 0.85

Tested by

no test coverage detected