Commit d23d73c7 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo
Browse files

Merge pull request #500 from pietern/2.6-zipfix

Compare integers in ziplist regardless of encoding
parents 7f10703b 0ef88927
...@@ -773,12 +773,11 @@ unsigned int ziplistCompare(unsigned char *p, unsigned char *sstr, unsigned int ...@@ -773,12 +773,11 @@ unsigned int ziplistCompare(unsigned char *p, unsigned char *sstr, unsigned int
return 0; return 0;
} }
} else { } 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 (zipTryEncoding(sstr,slen,&sval,&sencoding)) {
if (entry.encoding == sencoding) { zval = zipLoadInteger(p+entry.headersize,entry.encoding);
zval = zipLoadInteger(p+entry.headersize,entry.encoding); return zval == sval;
return zval == sval;
}
} }
} }
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment