提交 d593c488 编写于 作者: P Pieter Noordhuis

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

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册