Like rdbSaveRawString() gets a Redis object instead. */
| 491 | |
| 492 | /* Like rdbSaveRawString() gets a Redis object instead. */ |
| 493 | ssize_t rdbSaveStringObject(rio *rdb, robj_roptr obj) { |
| 494 | /* Avoid to decode the object, then encode it again, if the |
| 495 | * object is already integer encoded. */ |
| 496 | if (obj->encoding == OBJ_ENCODING_INT) { |
| 497 | return rdbSaveLongLongAsStringObject(rdb,(long)ptrFromObj(obj)); |
| 498 | } else { |
| 499 | serverAssertWithInfo(NULL,obj,sdsEncodedObject(obj)); |
| 500 | return rdbSaveRawString(rdb,(unsigned char*)szFromObj(obj),sdslen(szFromObj(obj))); |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | /* Load a string object from an RDB file according to flags: |
| 505 | * |
no test coverage detected