summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-12 23:52:36 +0200
committerantirez <antirez@gmail.com>2014-04-12 23:52:36 +0200
commit3c3c16561a5e0896109a26a1cb50555dae996868 (patch)
tree6b0c4fa2fc9adc60c24e74f7fe1094c9233b561a
parenta9e057e095a6ccc38f79fe427c8a7624bbb57a4f (diff)
downloadredis-3c3c16561a5e0896109a26a1cb50555dae996868.tar.gz
Fix seqlen computation in hllSparseAdd().
-rw-r--r--src/hyperloglog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hyperloglog.c b/src/hyperloglog.c
index 8e0cba7ae..119cbab1c 100644
--- a/src/hyperloglog.c
+++ b/src/hyperloglog.c
@@ -779,7 +779,7 @@ int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
*
* Note that we already allocated space on the sds string
* calling sdsMakeRoomFor(). */
- int seqlen = seq-n;
+ int seqlen = n-seq;
int oldlen = is_xzero ? 2 : 1;
int deltalen = seqlen-oldlen;