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

Function verify

src/ziplist.c:1804–1819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1802}
1803
1804static void verify(unsigned char *zl, zlentry *e) {
1805 int len = ziplistLen(zl);
1806 zlentry _e;
1807
1808 ZIPLIST_ENTRY_ZERO(&_e);
1809
1810 for (int i = 0; i < len; i++) {
1811 memset(&e[i], 0, sizeof(zlentry));
1812 zipEntry(ziplistIndex(zl, i), &e[i]);
1813
1814 memset(&_e, 0, sizeof(zlentry));
1815 zipEntry(ziplistIndex(zl, -len+i), &_e);
1816
1817 assert(memcmp(&e[i], &_e, sizeof(zlentry)) == 0);
1818 }
1819}
1820
1821static unsigned char *insertHelper(unsigned char *zl, char ch, size_t len, unsigned char *pos) {
1822 assert(len <= ZIP_BIG_PREVLEN);

Callers 1

ziplistTestFunction · 0.85

Calls 3

ziplistLenFunction · 0.85
zipEntryFunction · 0.85
ziplistIndexFunction · 0.85

Tested by

no test coverage detected