Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7f1e1cae
Commit
7f1e1cae
authored
Jun 23, 2016
by
tielei
Committed by
antirez
Jul 04, 2016
Browse files
A string with 21 chars is not representable as a 64-bit integer.
parent
7a3a595f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
7f1e1cae
...
...
@@ -380,10 +380,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 2
1
chars is not
* Note that we are sure that a string larger than 2
0
chars is not
* representable as a 32 nor 64 bit integer. */
len
=
sdslen
(
s
);
if
(
len
<=
2
1
&&
string2l
(
s
,
len
,
&
value
))
{
if
(
len
<=
2
0
&&
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment