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

Function zuiLongLongFromValue

src/t_zset.cpp:2224–2240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2222}
2223
2224int zuiLongLongFromValue(zsetopval *val) {
2225 if (!(val->flags & OPVAL_DIRTY_LL)) {
2226 val->flags |= OPVAL_DIRTY_LL;
2227
2228 if (val->ele != NULL) {
2229 if (string2ll(val->ele,sdslen(val->ele),&val->ell))
2230 val->flags |= OPVAL_VALID_LL;
2231 } else if (val->estr != NULL) {
2232 if (string2ll((char*)val->estr,val->elen,&val->ell))
2233 val->flags |= OPVAL_VALID_LL;
2234 } else {
2235 /* The long long was already set, flag as valid. */
2236 val->flags |= OPVAL_VALID_LL;
2237 }
2238 }
2239 return val->flags & OPVAL_VALID_LL;
2240}
2241
2242sds zuiSdsFromValue(zsetopval *val) {
2243 if (val->ele == NULL) {

Callers 1

zuiFindFunction · 0.85

Calls 2

sdslenFunction · 0.85
string2llFunction · 0.70

Tested by

no test coverage detected