MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / dictNext

Function dictNext

src/dict.cpp:945–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943}
944
945dictEntry *dictNext(dictIterator *iter)
946{
947 while (1) {
948 if (iter->entry == NULL) {
949 dictht *ht = &iter->d->ht[iter->table];
950 if (iter->index == -1 && iter->table == 0) {
951 if (iter->safe)
952 dictPauseRehashing(iter->d);
953 else
954 iter->fingerprint = dictFingerprint(iter->d);
955 }
956 iter->index++;
957 if (iter->index >= (long) ht->size) {
958 if (dictIsRehashing(iter->d) && iter->table == 0) {
959 iter->table++;
960 iter->index = 0;
961 ht = &iter->d->ht[1];
962 } else {
963 break;
964 }
965 }
966 iter->entry = ht->table[iter->index];
967 } else {
968 iter->entry = iter->nextEntry;
969 }
970 if (iter->entry) {
971 /* We need to save the 'next' here, the iterator user
972 * may delete the entry we are returning. */
973 iter->nextEntry = iter->entry->next;
974 return iter->entry;
975 }
976 }
977 return NULL;
978}
979
980void dictReleaseIterator(dictIterator *iter)
981{

Callers 15

iterateMethod · 0.70
storeDatabaseMethod · 0.70
processChangesMethod · 0.70
processChangesAsyncMethod · 0.70
commitChangesMethod · 0.70
pubsubPublishMessageFunction · 0.70
pubsubCommandFunction · 0.70
latencyResetEventFunction · 0.70
createLatencyReportFunction · 0.70

Calls 1

dictFingerprintFunction · 0.85

Tested by

no test coverage detected