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

Function getDecodedObject

app/redis-6.2.6/src/object.c:519–535  ·  view source on GitHub ↗

Get a decoded version of an encoded object (returned as a new object). * If the object is already raw-encoded just increment the ref count. */

Source from the content-addressed store, hash-verified

517/* Get a decoded version of an encoded object (returned as a new object).
518 * If the object is already raw-encoded just increment the ref count. */
519robj *getDecodedObject(robj *o) {
520 robj *dec;
521
522 if (sdsEncodedObject(o)) {
523 incrRefCount(o);
524 return o;
525 }
526 if (o->type == OBJ_STRING && o->encoding == OBJ_ENCODING_INT) {
527 char buf[32];
528
529 ll2string(buf,32,(long)o->ptr);
530 dec = createStringObject(buf,strlen(buf));
531 return dec;
532 } else {
533 serverPanic("Unknown encoding type");
534 }
535}
536
537/* Compare two string objects via strcmp() or strcoll() depending on flags.
538 * Note that the objects may be integer-encoded. In such a case we

Callers 15

pubsubPublishMessageFunction · 0.85
stralgoLCSFunction · 0.85
bitopCommandFunction · 0.85
dictEncObjKeyCompareFunction · 0.85
rdbLoadObjectFunction · 0.85
dbUnshareStringValueFunction · 0.85
clusterSendPublishFunction · 0.85
feedAppendOnlyFileFunction · 0.85
xorStringObjectDigestFunction · 0.85
mixStringObjectDigestFunction · 0.85

Calls 3

incrRefCountFunction · 0.85
ll2stringFunction · 0.85
createStringObjectFunction · 0.70

Tested by

no test coverage detected