Skip to content

Commit

Permalink
A string with 21 chars is not representable as a 64-bit integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
tielei committed Jun 23, 2016
1 parent 3d48c93 commit f648c5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f648c5a

Please sign in to comment.