Commit d593c488 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

modify compare function to check if the encoding is equal before comparing

parent a5456b2c
......@@ -461,12 +461,12 @@ unsigned int ziplistCompare(unsigned char *p, unsigned char *s, unsigned int sle
return 0;
}
} else {
/* Try to compare encoded values */
if (zipTryEncoding(s,&sval,&sencoding)) {
/* Do integer compare */
val = zipLoadInteger(p+entry.headersize,entry.encoding);
return val == sval;
} else {
/* Ziplist entry is integer encoded, but given entry is not. */
if (entry.encoding == sencoding) {
val = zipLoadInteger(p+entry.headersize,entry.encoding);
return val == sval;
}
}
}
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