MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getStringObjectLen

Function getStringObjectLen

src/networking.cpp:66–73  ·  view source on GitHub ↗

Return the length of a string object. * This does NOT includes internal fragmentation or sds unused space. */

Source from the content-addressed store, hash-verified

64/* Return the length of a string object.
65 * This does NOT includes internal fragmentation or sds unused space. */
66size_t getStringObjectLen(robj *o) {
67 serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
68 switch(o->encoding) {
69 case OBJ_ENCODING_RAW: return sdslen(szFromObj(o));
70 case OBJ_ENCODING_EMBSTR: return sdslen(szFromObj(o));
71 default: return 0; /* Just integer encoding for now. */
72 }
73}
74
75/* Client.reply list dup and free methods. */
76void *dupClientReplyValue(void *o) {

Callers 2

Calls 2

sdslenFunction · 0.85
szFromObjFunction · 0.85

Tested by

no test coverage detected