summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-12 16:37:11 +0200
committerantirez <antirez@gmail.com>2014-04-12 16:37:50 +0200
commitf5c03044a6ff53daeafce786908c548645312964 (patch)
tree9786b3480fdda4ecd3d78e482dd8d2860998a76f
parentb5659cb0a6c25d26d5dad0675a99e20bade986ed (diff)
downloadredis-f5c03044a6ff53daeafce786908c548645312964.tar.gz
Fix HLL sparse object creation #2.
Two vars initialized to wrong values in createHLLObject().
-rw-r--r--src/hyperloglog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index 969a86599..704c51376 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -925,11 +925,11 @@ robj *createHLLObject(void) {
/* Populate the sparse representation with as many XZERO opcodes as
* needed to represent all the registers. */
- aux = sparselen;
+ aux = HLL_REGISTERS;
s = sdsnewlen(NULL,sparselen);
p = (uint8_t*)s + HLL_HDR_SIZE;
while(aux) {
- int xzero = HLL_SPARSE_XZERO_MAX_LEN-1;
+ int xzero = HLL_SPARSE_XZERO_MAX_LEN;
if (xzero > aux) xzero = aux;
HLL_SPARSE_XZERO_SET(p,xzero);
p += 2;