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

Function lpFirst

src/listpack.c:479–484  ·  view source on GitHub ↗

Return a pointer to the first element of the listpack, or NULL if the * listpack has no elements. */

Source from the content-addressed store, hash-verified

477/* Return a pointer to the first element of the listpack, or NULL if the
478 * listpack has no elements. */
479unsigned char *lpFirst(unsigned char *lp) {
480 unsigned char *p = lp + LP_HDR_SIZE; /* Skip the header. */
481 if (p[0] == LP_EOF) return NULL;
482 lpAssertValidEntry(lp, lpBytes(lp), p);
483 return p;
484}
485
486/* Return a pointer to the last element of the listpack, or NULL if the
487 * listpack has no elements. */

Callers 9

rdbLoadObjectFunction · 0.85
lpLengthFunction · 0.85
lpSeekFunction · 0.85
lpGetEdgeStreamIDFunction · 0.85
streamLogListpackContentFunction · 0.85
streamAppendItemFunction · 0.85
streamTrimFunction · 0.85
streamIteratorGetIDFunction · 0.85

Calls 2

lpAssertValidEntryFunction · 0.85
lpBytesFunction · 0.85

Tested by

no test coverage detected