Skip to content

Commit

Permalink
Merge pull request #500 from pietern/2.6-zipfix
Browse files Browse the repository at this point in the history
Compare integers in ziplist regardless of encoding
  • Loading branch information
antirez committed May 6, 2012
2 parents 7f10703 + 0ef8892 commit d23d73c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ziplist.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,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;
Expand Down

0 comments on commit d23d73c

Please sign in to comment.