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.
This commit is contained in:
antirez 2015-02-27 16:08:50 +01:00
parent 0e5e8ca9e6
commit 4f56f035a7

View File

@ -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);
}
}