Skip to content

Commit f648c5a

Browse files
committedJun 23, 2016
A string with 21 chars is not representable as a 64-bit integer.
1 parent 3d48c93 commit f648c5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ robj *tryObjectEncoding(robj *o) {
385385
if (o->refcount > 1) return o;
386386

387387
/* Check if we can represent this string as a long integer.
388-
* Note that we are sure that a string larger than 21 chars is not
388+
* Note that we are sure that a string larger than 20 chars is not
389389
* representable as a 32 nor 64 bit integer. */
390390
len = sdslen(s);
391-
if (len <= 21 && string2l(s,len,&value)) {
391+
if (len <= 20 && string2l(s,len,&value)) {
392392
/* This object is encodable as a long. Try to use a shared object.
393393
* Note that we avoid using shared integers when maxmemory is used
394394
* because every object needs to have a private LRU field for the LRU

0 commit comments

Comments
 (0)