summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-14 11:04:11 +0200
committerantirez <antirez@gmail.com>2014-04-14 11:04:11 +0200
commit142d133c8a9d83540b4543796ec108d913024304 (patch)
tree60c342fc192253bc8dca0d1702655b5376fc512b
parent1ee18db922aaf03cc1e0f04a5b0d9764f9d0ceb5 (diff)
downloadredis-142d133c8a9d83540b4543796ec108d913024304.tar.gz
hllSparseAdd() opcode seek stop condition 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 1b675b2e8..92427ef5c 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -668,7 +668,7 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
else if (HLL_SPARSE_IS_XZERO(p)) span = HLL_SPARSE_XZERO_LEN(p);
else span = HLL_SPARSE_VAL_LEN(p);
/* Break if this opcode covers the register as 'index'. */
- if (first+span >= index) break;
+ if (index <= first+span-1) break;
prev = p;
p += (HLL_SPARSE_IS_XZERO(p)) ? 2 : 1;
first += span;