| 501 | } |
| 502 | |
| 503 | dictEntry *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 | |
| 524 | void *dictFetchValue(dict *d, const void *key) { |
| 525 | dictEntry *he; |
no test coverage detected