Move to the previous entry based on the values in eptr and sptr. Both are * set to NULL when there is no next entry. */
| 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. */ |
| 810 | void 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. */ |
no test coverage detected