X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/dcd4efe9ef68b3fa01f5e9e5f8bcb86cea2d15af..f0d962c0eca870e3fd2a4529de321db217c2e9fe:/src/ziplist.c?ds=inline diff --git a/src/ziplist.c b/src/ziplist.c index 420f1304..31e61633 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -346,7 +346,6 @@ static int64_t zipLoadInteger(unsigned char *p, unsigned char encoding) { int16_t i16; int32_t i32; int64_t i64, ret = 0; - printf("%02x\n", encoding); if (encoding == ZIP_INT_8B) { ret = ((char*)p)[0]; } else if (encoding == ZIP_INT_16B) { @@ -774,12 +773,11 @@ unsigned int ziplistCompare(unsigned char *p, unsigned char *sstr, unsigned int return 0; } } else { - /* Try to compare encoded values */ + /* Try to compare encoded values. Don't compare encoding because + * different implementations may encoded integers differently. */ if (zipTryEncoding(sstr,slen,&sval,&sencoding)) { - if (entry.encoding == sencoding) { - zval = zipLoadInteger(p+entry.headersize,entry.encoding); - return zval == sval; - } + zval = zipLoadInteger(p+entry.headersize,entry.encoding); + return zval == sval; } } return 0;