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
e3f5a386
Commit
e3f5a386
authored
Apr 12, 2014
by
antirez
Browse files
hllSparseSum(): multiply 1 * runlen for zero entries.
parent
5b69b984
Changes
1
Show whitespace changes
Inline
Side-by-side
src/hyperloglog.c
View file @
e3f5a386
...
...
@@ -823,13 +823,13 @@ double hllSparseSum(uint8_t *sparse, int sparselen, double *PE, int *ezp) {
runlen = HLL_SPARSE_ZERO_LEN(p);
idx += runlen;
ez += runlen;
E
+=
1
;
/* 2^(-reg[j]) is 1 when m is 0. */
E += 1
*runlen
; /* 2^(-reg[j]) is 1 when m is 0. */
p++;
} else if (HLL_SPARSE_IS_XZERO(p)) {
runlen = HLL_SPARSE_XZERO_LEN(p);
idx += runlen;
ez += runlen;
E
+=
1
;
/* 2^(-reg[j]) is 1 when m is 0. */
E += 1
*runlen
; /* 2^(-reg[j]) is 1 when m is 0. */
p += 2;
} else {
runlen = HLL_SPARSE_VAL_LEN(p);
...
...
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