mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 00:50:50 +00:00
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:
parent
0e5e8ca9e6
commit
4f56f035a7
@ -529,9 +529,7 @@ size_t stringObjectLen(robj *o) {
|
|||||||
if (sdsEncodedObject(o)) {
|
if (sdsEncodedObject(o)) {
|
||||||
return sdslen(o->ptr);
|
return sdslen(o->ptr);
|
||||||
} else {
|
} else {
|
||||||
char buf[32];
|
return sdigits10((long)o->ptr);
|
||||||
|
|
||||||
return ll2string(buf,32,(long)o->ptr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user