summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-12 16:46:08 +0200
committerantirez <antirez@gmail.com>2014-04-16 15:26:27 +0200
commitc277169ed7d22913f04abca2c190bf233f0f74fa (patch)
tree3dc7a9d38fab17fdfa64502e7f505d20fe46ecfb
parentb6ca71a40af9be9775d67681647dc496cb5da928 (diff)
downloadredis-c277169ed7d22913f04abca2c190bf233f0f74fa.tar.gz
Macro HLL_SPARSE_XZERO_LEN fixed.
-rw-r--r--src/hyperloglog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index 704c51376..beacee887 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -365,7 +365,7 @@ struct hllhdr {
#define HLL_SPARSE_IS_XZERO(p) (((*p) & 0xc0) == HLL_SPARSE_XZERO_BIT)
#define HLL_SPARSE_IS_VAL(p) ((*p) & HLL_SPARSE_VAL_BIT)
#define HLL_SPARSE_ZERO_LEN(p) (((*p) & 0x3f)+1)
-#define HLL_SPARSE_XZERO_LEN(p) (((((*p) & 0x3f) << 6) | (*p))+1)
+#define HLL_SPARSE_XZERO_LEN(p) (((((*p) & 0x3f) << 8) | (*(p+1)))+1)
#define HLL_SPARSE_VAL_VALUE(p) ((((*p) >> 2) & 0x1f)+1)
#define HLL_SPARSE_VAL_LEN(p) (((*p) & 0x3)+1)
#define HLL_SPARSE_VAL_MAX_VALUE 32