Commit 4f56f035 authored by antirez's avatar antirez
Browse files

String: use new sdigits10() API in stringObjectLen().

Should be much faster, and regardless, the code is more obvious now
compared to generating a string just to get the return value of the
ll2stirng() function.
parent 0e5e8ca9
......@@ -529,9 +529,7 @@ size_t stringObjectLen(robj *o) {
if (sdsEncodedObject(o)) {
return sdslen(o->ptr);
} else {
char buf[32];
return ll2string(buf,32,(long)o->ptr);
return sdigits10((long)o->ptr);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment