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

Function rdbSaveStringObject

app/redis-6.2.6/src/rdb.c:484–493  ·  view source on GitHub ↗

Like rdbSaveRawString() gets a Redis object instead. */

Source from the content-addressed store, hash-verified

482
483/* Like rdbSaveRawString() gets a Redis object instead. */
484ssize_t rdbSaveStringObject(rio *rdb, robj *obj) {
485 /* Avoid to decode the object, then encode it again, if the
486 * object is already integer encoded. */
487 if (obj->encoding == OBJ_ENCODING_INT) {
488 return rdbSaveLongLongAsStringObject(rdb,(long)obj->ptr);
489 } else {
490 serverAssertWithInfo(NULL,obj,sdsEncodedObject(obj));
491 return rdbSaveRawString(rdb,obj->ptr,sdslen(obj->ptr));
492 }
493}
494
495/* Load a string object from an RDB file according to flags:
496 *

Callers 3

rdbSaveObjectFunction · 0.85
rdbSaveKeyValuePairFunction · 0.85
RM_SaveStringFunction · 0.85

Calls 3

rdbSaveRawStringFunction · 0.85
sdslenFunction · 0.85

Tested by

no test coverage detected