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

Function lpLast

src/listpack.c:488–491  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

486/* Return a pointer to the last element of the listpack, or NULL if the
487 * listpack has no elements. */
488unsigned char *lpLast(unsigned char *lp) {
489 unsigned char *p = lp+lpGetTotalBytes(lp)-1; /* Seek EOF element. */
490 return lpPrev(lp,p); /* Will return NULL if EOF is the only element. */
491}
492
493/* Return the number of elements inside the listpack. This function attempts
494 * to use the cached value when within range, otherwise a full scan is

Callers 3

lpSeekFunction · 0.85
lpGetEdgeStreamIDFunction · 0.85
streamIteratorGetIDFunction · 0.85

Calls 1

lpPrevFunction · 0.85

Tested by

no test coverage detected