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

Function zzlPrev

src/t_zset.cpp:810–825  ·  view source on GitHub ↗

Move to the previous entry based on the values in eptr and sptr. Both are * set to NULL when there is no next entry. */

Source from the content-addressed store, hash-verified

808/* Move to the previous entry based on the values in eptr and sptr. Both are
809 * set to NULL when there is no next entry. */
810void zzlPrev(unsigned char *zl, unsigned char **eptr, unsigned char **sptr) {
811 unsigned char *_eptr, *_sptr;
812 serverAssert(*eptr != NULL && *sptr != NULL);
813
814 _sptr = ziplistPrev(zl,*eptr);
815 if (_sptr != NULL) {
816 _eptr = ziplistPrev(zl,_sptr);
817 serverAssert(_eptr != NULL);
818 } else {
819 /* No previous entry. */
820 _eptr = NULL;
821 }
822
823 *eptr = _eptr;
824 *sptr = _sptr;
825}
826
827/* Returns if there is a part of the zset is in range. Should only be used
828 * internally by zzlFirstInRange and zzlLastInRange. */

Callers 4

zuiNextFunction · 0.85

Calls 1

ziplistPrevFunction · 0.85

Tested by

no test coverage detected