summaryrefslogtreecommitdiff
path: root/src/hyperloglog.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-12 10:59:12 +0200
committerantirez <antirez@gmail.com>2014-04-12 10:59:12 +0200
commit1ccb661569635e07d146c133cdfdb9b648da2b99 (patch)
tree4e1e97d48928199443882bbde9bbfc2cf798bbf3 /src/hyperloglog.c
parenta79386b1af299fc708acb4fabee3fbe9d529eb0a (diff)
downloadredis-1ccb661569635e07d146c133cdfdb9b648da2b99.tar.gz
Fix HLL sparse object creation.
The function didn't considered the fact that each XZERO opcode is two bytes.
Diffstat (limited to 'src/hyperloglog.c')
-rw-r--r--src/hyperloglog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index 22d73ce44..5157cd8ef 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -913,8 +913,8 @@ robj *createHLLObject(void) {
sds s;
uint8_t *p;
int sparselen = HLL_HDR_SIZE +
- ((HLL_REGISTERS+(HLL_SPARSE_XZERO_MAX_LEN-1)) /
- HLL_SPARSE_XZERO_MAX_LEN);
+ (((HLL_REGISTERS+(HLL_SPARSE_XZERO_MAX_LEN-1)) /
+ HLL_SPARSE_XZERO_MAX_LEN)*2);
int aux;
/* Populate the sparse representation with as many XZERO opcodes as