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

Function lpSkip

src/listpack.c:445–450  ·  view source on GitHub ↗

Skip the current entry returning the next. It is invalid to call this * function if the current element is the EOF element at the end of the * listpack, however, while this function is used to implement lpNext(), * it does not return NULL when the EOF element is encountered. */

Source from the content-addressed store, hash-verified

443 * listpack, however, while this function is used to implement lpNext(),
444 * it does not return NULL when the EOF element is encountered. */
445unsigned char *lpSkip(unsigned char *p) {
446 unsigned long entrylen = lpCurrentEncodedSizeUnsafe(p);
447 entrylen += lpEncodeBacklen(NULL,entrylen);
448 p += entrylen;
449 return p;
450}
451
452/* If 'p' points to an element of the listpack, calling lpNext() will return
453 * the pointer to the next element (the one on the right), or NULL if 'p'

Callers 2

lpNextFunction · 0.85
lpInsertFunction · 0.85

Calls 2

lpEncodeBacklenFunction · 0.85

Tested by

no test coverage detected