MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ziplistGetObject

Function ziplistGetObject

app/redis-6.2.6/src/t_zset.c:749–762  ·  view source on GitHub ↗

Return a ziplist element as an SDS string. */

Source from the content-addressed store, hash-verified

747
748/* Return a ziplist element as an SDS string. */
749sds ziplistGetObject(unsigned char *sptr) {
750 unsigned char *vstr;
751 unsigned int vlen;
752 long long vlong;
753
754 serverAssert(sptr != NULL);
755 serverAssert(ziplistGet(sptr,&vstr,&vlen,&vlong));
756
757 if (vstr) {
758 return sdsnewlen((char*)vstr,vlen);
759 } else {
760 return sdsfromlonglong(vlong);
761 }
762}
763
764/* Compare element in sorted set with given element. */
765int zzlCompareElements(unsigned char *eptr, unsigned char *cstr, unsigned int clen) {

Callers 3

zzlLexValueGteMinFunction · 0.85
zzlLexValueLteMaxFunction · 0.85

Calls 3

ziplistGetFunction · 0.85
sdsnewlenFunction · 0.85
sdsfromlonglongFunction · 0.85

Tested by

no test coverage detected