| 846 | } |
| 847 | |
| 848 | dictEntry *dictFindWithPrev(dict *d, const void *key, uint64_t h, dictEntry ***dePrevPtr, dictht **pht, bool fShallowCompare) |
| 849 | { |
| 850 | dictEntry *he; |
| 851 | uint64_t idx, table; |
| 852 | |
| 853 | if (dictSize(d) == 0) return NULL; /* dict is empty */ |
| 854 | if (dictIsRehashing(d)) _dictRehashStep(d); |
| 855 | for (table = 0; table <= 1; table++) { |
| 856 | *pht = d->ht + table; |
| 857 | idx = h & d->ht[table].sizemask; |
| 858 | he = d->ht[table].table[idx]; |
| 859 | *dePrevPtr = &d->ht[table].table[idx]; |
| 860 | while(he) { |
| 861 | if (key==he->key || (!fShallowCompare && dictCompareKeys(d, key, he->key))) { |
| 862 | return he; |
| 863 | } |
| 864 | *dePrevPtr = &he->next; |
| 865 | he = he->next; |
| 866 | } |
| 867 | if (!dictIsRehashing(d)) return NULL; |
| 868 | } |
| 869 | return NULL; |
| 870 | } |
| 871 | |
| 872 | dictEntry *dictFind(dict *d, const void *key) |
| 873 | { |
no test coverage detected