From f648c5a70c802aeb60ee9773dfdcf7cf08a06357 Mon Sep 17 00:00:00 2001 From: tielei <43289893@qq.com> Date: Thu, 23 Jun 2016 19:53:56 +0800 Subject: [PATCH] A string with 21 chars is not representable as a 64-bit integer. --- src/object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/object.c b/src/object.c index 9d1d4b7e..ab927688 100644 --- a/src/object.c +++ b/src/object.c @@ -385,10 +385,10 @@ robj *tryObjectEncoding(robj *o) { if (o->refcount > 1) return o; /* Check if we can represent this string as a long integer. - * Note that we are sure that a string larger than 21 chars is not + * Note that we are sure that a string larger than 20 chars is not * representable as a 32 nor 64 bit integer. */ len = sdslen(s); - if (len <= 21 && string2l(s,len,&value)) { + if (len <= 20 && string2l(s,len,&value)) { /* This object is encodable as a long. Try to use a shared object. * Note that we avoid using shared integers when maxmemory is used * because every object needs to have a private LRU field for the LRU