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

Function isObjectRepresentableAsLongLong

src/object.cpp:453–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453int isObjectRepresentableAsLongLong(robj *o, long long *llval) {
454 serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
455 if (o->encoding == OBJ_ENCODING_INT) {
456 if (llval) *llval = (long) ptrFromObj(o);
457 return C_OK;
458 } else {
459 return isSdsRepresentableAsLongLong(szFromObj(o),llval);
460 }
461}
462
463/* Optimize the SDS string inside the string object to require little space,
464 * in case there is more than 10% of free space at the end of the SDS

Callers

nothing calls this directly

Calls 3

ptrFromObjFunction · 0.85
szFromObjFunction · 0.85

Tested by

no test coverage detected