Fix seqlen computation in hllSparseAdd().

This commit is contained in:
antirez 2014-04-12 23:52:36 +02:00
parent 5c770c87ee
commit c66e5e83a8

View File

@ -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;