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

Function getLongLongFromObject

src/object.cpp:724–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724int getLongLongFromObject(robj *o, long long *target) {
725 long long value;
726
727 if (o == NULL) {
728 value = 0;
729 } else {
730 serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
731 if (sdsEncodedObject(o)) {
732 if (string2ll(szFromObj(o),sdslen(szFromObj(o)),&value) == 0) return C_ERR;
733 } else if (o->encoding == OBJ_ENCODING_INT) {
734 value = (long)ptrFromObj(o);
735 } else {
736 serverPanic("Unknown string encoding");
737 }
738 }
739 if (target) *target = value;
740 return C_OK;
741}
742
743int getUnsignedLongLongFromObject(robj *o, uint64_t *target) {
744 uint64_t value;

Callers 10

getSlotOrReplyFunction · 0.85
clusterCommandFunction · 0.85
replconfCommandFunction · 0.85
replicaReplayCommandFunction · 0.85
sentinelConfigSetCommandFunction · 0.85
sentinelSetCommandFunction · 0.85
cronCommandFunction · 0.85
bitopCommandFunction · 0.85

Calls 4

szFromObjFunction · 0.85
sdslenFunction · 0.85
ptrFromObjFunction · 0.85
string2llFunction · 0.70

Tested by

no test coverage detected