Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9682295f
Commit
9682295f
authored
Apr 03, 2014
by
antirez
Browse files
PFCOUNT: unshare the object when cached cardinality is modified.
parent
be9860d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hyperloglog.c
View file @
9682295f
...
...
@@ -541,6 +541,9 @@ void pfcountCommand(redisClient *c) {
card
|=
(
uint64_t
)
registers
[
REDIS_HLL_SIZE
-
9
]
<<
56
;
}
else
{
/* Recompute it and update the cached value. */
o
=
dbUnshareStringValue
(
c
->
db
,
c
->
argv
[
1
],
o
);
registers
=
o
->
ptr
;
card
=
hllCount
(
registers
);
registers
[
REDIS_HLL_SIZE
-
16
]
=
card
&
0xff
;
registers
[
REDIS_HLL_SIZE
-
15
]
=
(
card
>>
8
)
&
0xff
;
...
...
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