From 0b7d08efb985781bddadc8e528fef9bd4cadb863 Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 12 Apr 2014 16:47:50 +0200 Subject: [PATCH] hllSparseSum(): multiply 1 * runlen for zero entries. --- src/hyperloglog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index beacee887..7dfc34c19 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -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);