From 1ccb661569635e07d146c133cdfdb9b648da2b99 Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 12 Apr 2014 10:59:12 +0200 Subject: [PATCH] Fix HLL sparse object creation. The function didn't considered the fact that each XZERO opcode is two bytes. --- src/hyperloglog.c | 4 ++-- 1 file 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