From 4f56f035a70293be6fbc20a0545c1be53a131e7c Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 27 Feb 2015 16:08:50 +0100 Subject: 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. --- src/object.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.1