mirror of
https://github.com/fluencelabs/redis
synced 2025-07-03 19:01:33 +00:00
modify compare function to check if the encoding is equal before comparing
This commit is contained in:
10
ziplist.c
10
ziplist.c
@ -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;
|
||||
|
Reference in New Issue
Block a user