summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-02-27 16:08:50 +0100
committerantirez <antirez@gmail.com>2015-02-27 16:09:17 +0100
commit4f56f035a70293be6fbc20a0545c1be53a131e7c (patch)
tree635def143aa7119dcbdc9352f0a819111ba7d21f
parent0e5e8ca9e67dbd9e8cd943db343564d26ca7e398 (diff)
downloadredis-4f56f035a70293be6fbc20a0545c1be53a131e7c.tar.gz
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.
-rw-r--r--src/object.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/object.c b/src/object.c
index f75421ee8..8905db18d 100644
--- a/src/object.c
+++ b/src/object.c
@@ -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);
}
}